Submission #26770

#TimeUsernameProblemLanguageResultExecution timeMemory
26770baactreeHotter Colder (IOI10_hottercolder)C++14
81 / 100
762 ms8348 KiB
#include "grader.h" typedef long long ll; int HC(int N){ ll le,ri; ll st,fi; st=1; fi=N; le=1; ri=N; ll pre=-1e9; while(true){ if(le==ri) return le; ll mid=(le+ri)/2; ll x=2*mid-pre; if(x==pre) x++; if(x>=st&&x<=fi){ int k=Guess(x); if(k==0) return (x+pre)/2; else if(k>0){ if(x<pre){ ri=(x+pre)/2-((x+pre)%2==0); pre=x; } else{ le=(x+pre)/2+1; pre=x; } } else{ if(x<pre){ le=(x+pre)/2+1; pre=x; } else{ ri=(x+pre)/2-((x+pre)%2==0); pre=x; } } } else{ x=(le*2+ri)/3; Guess(x); pre=x; } } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...