# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
265005 | arayi | The Big Prize (IOI17_prize) | C++17 | 58 ms | 384 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"
#include <algorithm>
using namespace std;
int as(int a)
{
vector <int> fp = ask(a);
if(fp[0] + fp[1] == 0) return 0;
if(fp[0]) return -1;
return 1;
}
int find_best(int n) {
int l = 0, r = n - 1;
while(l <= r)
{
int mid = (l + r)/2;
int sm = as(mid);
if(sm == 0) return mid;
if(sm == 1) l = mid + 1;
if(sm == -1) r = mid - 1;
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |