# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
102064 | 2019-03-22T01:43:27 Z | tim25871014 | The Big Prize (IOI17_prize) | C++17 | 4 ms | 512 KB |
#include "prize.h" #include <bits/stdc++.h> using namespace std; int find_best(int n){ int loli=0; for(int i=0;i<(int)min(500,n);i++){ vector<int> val=ask(i); loli=max(loli,val[0]+val[1]); } for(int i=0;i<n;i++){ vector<int> val=ask(i); if(val[0]+val[1]==0) return i; if(val[0]+val[1]==loli){ int lb=i,ub=n; while(ub-lb>1){ int mid=ub+lb>>1; vector<int> ser=ask(mid); if(val[0]==ser[0] && ser[0]+ser[1]==loli) lb=mid; else ub=mid; } i=lb+1; } } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 4 ms | 504 KB | Integer 200001 violates the range [0, 199999] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 4 ms | 512 KB | Integer 200001 violates the range [0, 199999] |
2 | Halted | 0 ms | 0 KB | - |