Submission #584435

#TimeUsernameProblemLanguageResultExecution timeMemory
584435PiejanVDCThe Big Prize (IOI17_prize)C++17
20 / 100
92 ms296 KiB
#include <bits/stdc++.h> #include "prize.h" using namespace std; int s(int l, int r) { int mid = (l+r)/2; vector<int>gt = ask(mid); if(!gt[0] && !gt[1]) return mid; if(l == r) return -1; int a = -1, b = -1; if(gt[0] && l < mid) a = s(l, mid-1); if(gt[1] && r > mid) b = s(mid+1, r); return max(a,b); } int find_best(int n) { return s(0,n-1); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...