Submission #596376

#TimeUsernameProblemLanguageResultExecution timeMemory
596376mosiashvililukaHotter Colder (IOI10_hottercolder)C++14
77 / 100
1004 ms24420 KiB
#include "grader.h" #include<bits/stdc++.h> using namespace std; int a,b,c,d,e,i,j,ii,jj,zx,xc,pas,pi; pair <int, int> p[1009]; int ask(int q){ if(p[pi].first==q){ return p[pi].second; } pi++;p[pi]={q,Guess(q)}; return p[pi].second; } void rec(int q, int w){ if(q==w){ pas=q; return; } if(rand()%2){ Guess(q); c=Guess(w); if(c==0){ pas=(q+w)/2; return; } if(c==-1){ int mid=0; if((q+w)%2!=0) mid=(q+w)/2; else mid=(q+w)/2-1; rec(q,mid); }else{ int mid=0; mid=(q+w)/2+1; rec(mid,w); } }else{ Guess(w); c=Guess(q); if(c==0){ pas=(q+w)/2; return; } if(c==1){ int mid=0; if((q+w)%2!=0) mid=(q+w)/2; else mid=(q+w)/2-1; rec(q,mid); }else{ int mid=0; mid=(q+w)/2+1; rec(mid,w); } } } int HC(int NN){ a=NN;pas=0;pi=0; rec(1,a); return pas; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...