# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
650244 | ojoConmigo | The Big Prize (IOI17_prize) | C++17 | 1 ms | 336 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 "prize.h"
int find_best(int n) {
/*
for(int i = 0; i < n; i++) {
std::vector<int> res = ask(i);
if(res[0] + res[1] == 0)
return i;
}
*/
//Subtask 1
std::vector<int> res;
int lo = 0, hi = n-1,ans = -1;
while(lo <= hi){
int mid = (lo+hi)/2;
res = ask(mid);
if(res[0] + res[1] == 0){
return mid;
}else if(res[0]){
hi = mid-1;
}else{
lo = mid+1;
}
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |