#include "prize.h"
#include<bits/stdc++.h>
using namespace std;
int find_best(int n) {
int l = 0, r = n;
for (int i = 0; i < 500; i++){
while (true){
int m = (l+r)/2;
vector<int> res = ask(m);
if (res[0]+res[1] == 0) return m;
if (m == l) break;
if (res[0] > i) r = m;
else l = m;
}
l = 0;
r = n;
}
return 75;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
344 KB |
Output is correct |
3 |
Correct |
0 ms |
596 KB |
Output is correct |
4 |
Correct |
0 ms |
600 KB |
Output is correct |
5 |
Correct |
0 ms |
344 KB |
Output is correct |
6 |
Correct |
0 ms |
340 KB |
Output is correct |
7 |
Correct |
0 ms |
344 KB |
Output is correct |
8 |
Correct |
0 ms |
344 KB |
Output is correct |
9 |
Correct |
0 ms |
344 KB |
Output is correct |
10 |
Correct |
1 ms |
344 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Correct |
1 ms |
344 KB |
Output is correct |
4 |
Correct |
1 ms |
344 KB |
Output is correct |
5 |
Correct |
1 ms |
344 KB |
Output is correct |
6 |
Correct |
1 ms |
344 KB |
Output is correct |
7 |
Correct |
1 ms |
344 KB |
Output is correct |
8 |
Correct |
0 ms |
344 KB |
Output is correct |
9 |
Correct |
1 ms |
344 KB |
Output is correct |
10 |
Correct |
1 ms |
500 KB |
Output is correct |
11 |
Correct |
2 ms |
504 KB |
Output is correct |
12 |
Correct |
1 ms |
344 KB |
Output is correct |
13 |
Correct |
4 ms |
600 KB |
Output is correct |
14 |
Correct |
2 ms |
344 KB |
Output is correct |
15 |
Correct |
5 ms |
344 KB |
Output is correct |
16 |
Partially correct |
36 ms |
344 KB |
Partially correct - number of queries: 7302 |
17 |
Correct |
0 ms |
344 KB |
Output is correct |
18 |
Partially correct |
48 ms |
344 KB |
Partially correct - number of queries: 8806 |
19 |
Correct |
0 ms |
344 KB |
Output is correct |
20 |
Correct |
9 ms |
344 KB |
Output is correct |
21 |
Correct |
15 ms |
344 KB |
Output is correct |
22 |
Correct |
3 ms |
596 KB |
Output is correct |
23 |
Correct |
1 ms |
344 KB |
Output is correct |
24 |
Correct |
0 ms |
344 KB |
Output is correct |
25 |
Correct |
18 ms |
344 KB |
Output is correct |
26 |
Incorrect |
36 ms |
344 KB |
answer is not correct |
27 |
Halted |
0 ms |
0 KB |
- |