# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
371338 | leinad2 | The Big Prize (IOI17_prize) | C++17 | 118 ms | 492 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 gg(int a, int b){if(a==0)return b;return a;}
int f(int l, int r)
{
if(l>r)return 0;
int m=l+r>>1;
vector<int>v=ask(m);
if(v[0]==0&&v[1]==0)return m;
if(v[1]==0)return f(l, m-1);
if(v[0]==0)return f(m+1, r);
return gg(f(l, m-1), f(m+1, r));
}
int find_best(int n)
{
return f(0, n-1);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |