Submission #206417

#TimeUsernameProblemLanguageResultExecution timeMemory
206417anonymousThe Big Prize (IOI17_prize)C++14
20 / 100
87 ms1228 KiB
#include "prize.h" #include<vector> #include<map> #include<utility> using namespace std; map<int, map<int, pair<int,int> > > M; int slv(int l, int r) { if (l == r) {return(l);} int mid = (l + r) >> 1; vector<int> res = ask(mid); if (res[0] + res[1] == 0) {return(mid);} int r1 = res[0] ? slv(l, mid-1) : -1, r2 = res[1] ? slv(mid+1, r) : -1; return(r1 != -1 ? r1 : r2); } int find_best(int n) { return(slv(0, n-1)); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...