# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
827029 | vnm06 | The Big Prize (IOI17_prize) | C++14 | 47 ms | 1908 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<bits/stdc++.h>
#include "prize.h"
using namespace std;
bool findans=0;
int pos=0, brask=0;
int maxsum=0;
void solve(int le, int ri, int bal_le, int bal_ri, int br)
{
if(le>ri || !br) return;
int mid=(le+ri)/2;
vector<int> res=ask(mid);
if(res[0] + res[1] == 0)
{
findans=1;
pos=mid;
return;
}
if(res[0]+res[1]==maxsum)
{
solve(le, mid-1, bal_le, res[1], res[0]-bal_le);
if(findans) return;
solve(mid+1, ri, res[0], bal_ri, res[1]-bal_ri);
return;
}
int m2=mid;
while(m2-1>=le && res[0]+res[1]!=maxsum)
{
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |