# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
101928 | 2019-03-21T05:52:48 Z | tim25871014 | The Big Prize (IOI17_prize) | C++17 | 65 ms | 432 KB |
#include "prize.h" using namespace std; int find_best(int n){ int loli=0; for(int i=0;i<500;i++){ vector<int> ans=ask(i); loli=max(loli,ans[0]+ans[1]); } int l=0; while(ask(l)[1]!=0){ int ub=n+1,lb=l; vector<int> ans; int mid=1; while(ub-lb>1 && mid){ mid=ub+lb>>1; while(ans=ask(mid),ans[0]+ans[1]!=loli){ if(ans[0]+ans[1]==0) return mid; mid--; } if(ans[0]) ub=mid; else lb=mid; } ans=ask(lb); if(ans[0]+ans[1]==0) return lb; else l=lb+1; } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 316 KB | Output is correct |
2 | Correct | 4 ms | 312 KB | Output is correct |
3 | Correct | 3 ms | 384 KB | Output is correct |
4 | Correct | 4 ms | 384 KB | Output is correct |
5 | Correct | 6 ms | 312 KB | Output is correct |
6 | Correct | 6 ms | 384 KB | Output is correct |
7 | Correct | 7 ms | 420 KB | Output is correct |
8 | Correct | 5 ms | 308 KB | Output is correct |
9 | Correct | 7 ms | 312 KB | Output is correct |
10 | Correct | 4 ms | 384 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 432 KB | Output is correct |
2 | Correct | 7 ms | 384 KB | Output is correct |
3 | Correct | 7 ms | 284 KB | Output is correct |
4 | Correct | 5 ms | 384 KB | Output is correct |
5 | Correct | 6 ms | 256 KB | Output is correct |
6 | Correct | 7 ms | 304 KB | Output is correct |
7 | Correct | 6 ms | 256 KB | Output is correct |
8 | Correct | 5 ms | 384 KB | Output is correct |
9 | Correct | 6 ms | 256 KB | Output is correct |
10 | Correct | 6 ms | 384 KB | Output is correct |
11 | Incorrect | 65 ms | 256 KB | Incorrect |
12 | Halted | 0 ms | 0 KB | - |