# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
423107 | Pbezz | The Big Prize (IOI17_prize) | C++14 | 1 ms | 320 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;
#define ll long long
#define pb push_back
typedef pair<ll,ll> pii;
const ll MAXN=2e5+5;
const ll INF=1e9+7;
int find_best(int n) {
ll i;
ll lo=0,hi=n-1,mid;
while(hi-lo>=2){
mid = lo+(hi-lo)/2;
vector<int> res = ask(mid);
if(res[0]+res[1]==0)return mid;
if(res[0]==1){
hi=mid;
}else{
lo=mid;
}
}
for(i=lo;i<=hi;i++){
vector<int> res = ask(mid);
if(res[0]+res[1]==0)return mid;
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |