# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
288981 | wdjpng | The Big Prize (IOI17_prize) | C++17 | 3030 ms | 512 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"
#define lint long long
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
int find_best(int n)
{
int oldSum = 1e9;
int curI = -1;
bool first=true;
int q=0;
while (true)
{
int start=-1, end=n;
while(end-start>1){
int cur = (start+end)/2;
if(q==1e4){while (true)
{
q++;
}
}
vector<int>ans=ask(cur);
q++;
if(first){
first=false;
oldSum=ans[0]+ans[1];
}
if(ans[0]+ans[1]==0){return cur;}
if(ans[0]+ans[1]<oldSum){
oldSum=ans[0]+ans[1];
break;
}
else if(ans[0]) end=cur;
else start=cur;
}
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |