Submission #434235

#TimeUsernameProblemLanguageResultExecution timeMemory
434235AmineTrabelsiThe Big Prize (IOI17_prize)C++14
20 / 100
1 ms284 KiB
#include "prize.h" #include <bits/stdc++.h> using namespace std; int find_best(int n) { // 20 points: // 1 diamond int low = 0,high = n-1; int ans = -1; while(low != high){ int mid = (low+high)/2; vector<int> q = ask(mid); if(q[0] == 1){ high = mid-1; }else if(q[1] == 1){ low = mid+1; }else{ ans = mid; break; } } return (ans == -1 ? low : ans); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...