Submission #827029

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
8270292023-08-16 08:11:00vnm06The Big Prize (IOI17_prize)C++14
20 / 100
47 ms1908 KiB
#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)
{
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...