标签:off ret 随机 ros 如何 pre 描述 决定 tle
class Solution { public: bool IsContinuous(vector<int> numbers) { if (numbers.empty()) return false; sort(numbers.begin(), numbers.end()); int zeros = 0; for (int i = 0; i < 5; i++) { if (numbers[i] == 0) zeros++; } int count = 0; if (zeros <= 3) { for (int i = zeros; i < 4; i++) { count += numbers[i + 1] - numbers[i]; } return (count <= 4 && count > 0) ? true : false; } else if (zeros == 4) return true; return false; } };
标签:off ret 随机 ros 如何 pre 描述 决定 tle
原文地址:https://www.cnblogs.com/ruoh3kou/p/10159815.html