# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1023929 | Andrey | The Big Prize (IOI17_prize) | C++14 | 58 ms | 424 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 ans = -1;
void calc(int l, int r) {
if(l > r) {
return;
}
int m = (l+r)/2;
vector<int> haha = ask(m);
if(haha[0]+haha[1] == 0) {
ans = m;
return;
}
if(l == r) {
return;
}
if(haha[0] > 0 && ans == -1) {
calc(l,m-1);
}
if(haha[1] > 0 && ans == -1) {
calc(m+1,r);
}
}
int find_best(int n) {
calc(0,n-1);
if(ans == -1) {
return 1/0;
}
return ans;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |