# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
778564 | khshg | The Big Prize (IOI17_prize) | C++14 | 79 ms | 348 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<bits/stdc++.h>
using namespace std;
int find_best(int N) {
int i;
int mx = 0;
for(; i < 473; ++i) {
vector<int> e = ask(i);
int sum = e[0] + e[1];
if(!sum) return i;
mx = max(mx, e[0] + e[1]);
}
while(true) {
vector<int> e = ask(i);
int sum = e[0] + e[1];
if(!sum) return i;
if(sum != mx) { ++i; continue; }
int tl = i + 1, tr = N;
while(tl < tr) {
int tm = (tl + tr) / 2;
vector<int> E = ask(tm);
if(e == E) {
tl = tm + 1;
} else {
tr = tm;
}
}
i = tr;
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |