#include "ant.h"
#include <algorithm>
using namespace std;
int FindK() {
int lo = 1;
int hi = 99999999;
int init = 66666666;
int c = DeliverCount(init);
if (c == 0) lo = init + 1;
else {
hi = init/c;
lo = init/(c+1);
}
while(lo < hi){
int mid = (lo+hi)>>1;
if (DeliverCount(mid))hi=mid;
else lo=mid+1;
}
return lo;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
248 KB |
Correct |
2 |
Correct |
2 ms |
356 KB |
Correct |
3 |
Correct |
2 ms |
356 KB |
Correct |
4 |
Correct |
2 ms |
440 KB |
Correct |
5 |
Correct |
2 ms |
440 KB |
Correct |