# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
101917 | 2019-03-21T03:12:53 Z | tim25871014 | The Big Prize (IOI17_prize) | C++17 | 0 ms | 0 KB |
#include "prize.h" using namespace std; int find_best(int n){ int crd[200010]={}; 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; while(ub-lb>1){ int mid=ub+lb>>1; if(!crd[mid]) ans=ask(mid); while((crd[mid])?(ans=ask(mid)),crd[mid] || ans[0]+ans[1]!=loli){ crd[mid]=1; 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; } }