#include "ant.h"
int max(int a, int b) { return a>b?a:b; }
int min(int a, int b) { return a<b?a:b; }
int FindK() {
int lo = 1, hi = 1e8;
int f = 0;
while(lo < hi) {
int mid = (lo + hi) / 2;
if(!f) f = 1, mid = (1<<26)-1;
int x = DeliverCount(mid);
if(!x) lo = mid + 1;
else {
lo = max(lo, (mid+x)/(x+1));
hi = min(hi, mid/x);
}
}
return lo;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
248 KB |
Correct |
2 |
Correct |
2 ms |
356 KB |
Correct |
3 |
Correct |
3 ms |
512 KB |
Correct |
4 |
Correct |
3 ms |
512 KB |
Correct |
5 |
Correct |
2 ms |
512 KB |
Correct |