# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
347422 | juggernaut | The Big Prize (IOI17_prize) | C++14 | 90 ms | 640 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>
#ifdef EVAL
#else
#include"grader.cpp"
#endif
using namespace std;
int mx;
int find_best(int n){
for(int i=0;i<n;i++){
auto res=ask(i);
if(!(res[0]|res[1]))return i;
mx=max(mx,res[0]+res[1]);
if(res[0]+res[1]!=mx)continue;
int l=i,r=n-1;
while(l<=r){
int mid=(l+r)>>1;
auto rs=ask(mid);
if(rs==res)l=mid+1,i=mid;
else r=mid-1;
}
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |