# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
753238 | boyliguanhan | The Big Prize (IOI17_prize) | C++17 | 75 ms | 10808 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;
set<int> st[200100];
int l[200100];
int calc(int x, int y) {
if(x>y)return-1;
int z = x+y>>1;
vector<int>v=ask(z);
int k=(l[z]=v[0])+v[1], t=-1;
if(!k) return z;
auto a = st[k].insert(z).first;
if(a==st[k].begin()||l[*prev(a)]<l[z])
t = max(t, calc(x, z-1));
if(a==(--st[k].end())||l[*next(a)]>l[z])
t = max(t, calc(z+1, y));
return t;
}
int find_best(int n) {
return calc(0,n-1);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |