# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
647453 | a_aguilo | The Big Prize (IOI17_prize) | C++14 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
#include "prize.h"
using namespace std;
int find_best(int n) {
int lo = 0; int hi = n-1;
while(hi >= lo){
int mid = lo + (hi - lo)/2;
int ans[2];
ans = ask(mid);
if (ans[0] == 0 and ans[1] == 0) return mid;
if(ans[0] == 0){
lo = mid+1;
}
else hi = mid-1;
}
return 0;
}