Submission #298460

#TimeUsernameProblemLanguageResultExecution timeMemory
298460medkThe Big Prize (IOI17_prize)C++14
20 / 100
71 ms416 KiB
#include <bits/stdc++.h> #include "prize.h" #define ll long long #define pb push_back #define x first #define y second #define sz(u) (int)(u.size()) #define all(u) u.begin(),u.end() using namespace std; vector<int> tmp; int find_best(int N){ int ptr=N-1; int curall=1, curR=1; while(1){ tmp=ask(ptr); curall=tmp[0]+tmp[1]; if(curall==0) break; curR=tmp[1]; int l=-1,r=ptr; while(l<r){ int md=(l+r+1)/2; tmp=ask(md); if(tmp[0]+tmp[1]!=curall || tmp[1]!=curR) l=md; else r=md-1; } tmp=ask(l+1); if(tmp[0]+tmp[1]==0){ ptr=l+1; break; } ptr=l; } return ptr; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...