Submission #295342

#TimeUsernameProblemLanguageResultExecution timeMemory
295342williamMBDKThe Big Prize (IOI17_prize)C++14
20 / 100
88 ms1272 KiB
#include "prize.h" #include<bits/stdc++.h> using namespace std; int ans = -1; void solve(int l, int r){ int m = (l + r) / 2; auto temp = ask(m); if(!temp[0] && !temp[1]) { ans = m; return; } if(temp[0] && l != r){ solve(l, m - 1); } if(temp[1] && l != r){ solve(m + 1, r); } } int find_best(int N) { solve(0, N - 1); return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...