Submission #566535

#TimeUsernameProblemLanguageResultExecution timeMemory
566535sofapudenThe Big Prize (IOI17_prize)C++14
20 / 100
61 ms296 KiB
#include "prize.h" #include<bits/stdc++.h> using namespace std; int ll = 0, rr = 0; int f(int l, int r){ if(l > r)return -1; int m = (l+r)/2; vector<int> v = ask(m); if(v[0] == 0)ll = l; if(v[1] == 1)rr = r; if(v[0] == 0 && v[1] == 0)return m; if(v[1] > v[0]){ int x = f(max(m+1,ll),min(r,rr)); if(x != -1)return x; } return f(max(l,ll),min(m-1,rr)); } int find_best(int n) { rr = n-1; return f(0,n-1); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...