# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
611408 | 2022-07-29T04:51:05 Z | Shithila | The Big Prize (IOI17_prize) | C++14 | 82 ms | 296 KB |
#include "prize.h" int find_best(int n) { int start=0; int end=n-1; int found=false; while(found==false) { int check=start+end; check=check/2; std::vector<int> res = ask(check); if(res[0]==0 && res[1]==0) { return check; found==true; } else if(res[0]==1) { end=check; } else if(res[1]==1) { start=check; } if(start==end-1) { if(check==start) { return end; found==true; } else { return start; found==true; } } } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 208 KB | Output is correct |
2 | Correct | 1 ms | 288 KB | Output is correct |
3 | Correct | 1 ms | 208 KB | Output is correct |
4 | Correct | 1 ms | 208 KB | Output is correct |
5 | Correct | 1 ms | 292 KB | Output is correct |
6 | Correct | 1 ms | 208 KB | Output is correct |
7 | Correct | 1 ms | 296 KB | Output is correct |
8 | Correct | 1 ms | 208 KB | Output is correct |
9 | Correct | 0 ms | 208 KB | Output is correct |
10 | Correct | 1 ms | 208 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 296 KB | Output is correct |
2 | Correct | 1 ms | 208 KB | Output is correct |
3 | Correct | 1 ms | 208 KB | Output is correct |
4 | Correct | 1 ms | 292 KB | Output is correct |
5 | Correct | 1 ms | 288 KB | Output is correct |
6 | Correct | 1 ms | 208 KB | Output is correct |
7 | Correct | 1 ms | 208 KB | Output is correct |
8 | Correct | 1 ms | 208 KB | Output is correct |
9 | Correct | 0 ms | 296 KB | Output is correct |
10 | Correct | 1 ms | 208 KB | Output is correct |
11 | Incorrect | 82 ms | 208 KB | Incorrect |
12 | Halted | 0 ms | 0 KB | - |