Submission #104414

#TimeUsernameProblemLanguageResultExecution timeMemory
104414BadralThe Big Prize (IOI17_prize)C++17
20 / 100
4 ms512 KiB
#include<bits/stdc++.h> #include "prize.h" using namespace std; int can(int k) { vector<int> cer = ask(k); if(cer[0] == 0 && cer[1] == 0) return 2; return (cer[0] == 0); } int find_best(int n) { int kk = -1; for(int i = n/2; i >= 1; i /= 2) { while(kk + i <= n) { int p = can(i+kk); if(p == 2) return (i + kk); if(p == 1) kk += i; else break; } } return kk; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...