Submission #769949

#TimeUsernameProblemLanguageResultExecution timeMemory
769949APROHACKThe Big Prize (IOI17_prize)C++14
20 / 100
1 ms336 KiB
#include "prize.h" #include <bits/stdc++.h> #define ll long long #define pb push_back #define ff first #define ss second using namespace std; int find_best(int n) { int li = 0, ls = n-1, pos; pos = (li + ls)/2; while(li + 1 < ls){ vector<int>ans = ask(pos); if(ans[0] > ans[1]){ ls = pos-1; }else if(ans[1] > ans[0]){ li = pos+1; }else{ return pos; } pos = (li + ls)/2; } vector<int>ans = ask(pos); if(ans[0] + ans[1] == 0)return pos; else return pos + 1; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...