第一题 100%第二题 50%X感觉写的很对,为什么错了呢,有无大佬帮忙看看X感谢评论区大佬给出错误原因,已经搞懂了class Solution {public:vector<long long> vec;bool check(long long mid){priority_queue<long long> q;for(int i = 0; i < 5; i ++) q.push(mid);for(auto x : vec){long long t = q.top();q.pop();q.push(t - x);}if(q.top() > 0) return false;else return true;}int maxTime(vector<int>& bat) {for(auto x : bat) vec.push_back(x);sort(vec.begin(), vec.end(), greater<long long>());int n = vec.size();long long l = 0, r = vec[0] * n / 5;while(l < r){long long mid = (l + r + 1) / 2;if(check(mid)) l = mid;else r = mid - 1;}return l;}};