제출 #976560

#제출 시각아이디문제언어결과실행 시간메모리
976560LaviniaTornaghiHotter Colder (IOI10_hottercolder)C++14
0 / 100
471 ms31632 KiB
#include <bits/stdc++.h> using namespace std; #include "grader.h" int n; int rec(int l, int r, bool isl){ //l'ultima query e' stata fatta a sx -> quella dopo su dx if(r-l==1){ if(isl){ return l; }else{ return r; } } int g; if(isl) g=Guess(r); else g=Guess(l); if(g==0) return (l+r)/2; if(isl){ if(g==1){ return rec((l+r)/2,r,0); } else{ Guess(l); return rec(l,min(n,(l+r)/2),1); } }else{ if(g==-1){ Guess(r); return rec((l+r)/2,r,0); } else { return rec(l,min(n,(l+r)/2),1); } } } int HC(int N){ n=N; Guess(1); return rec(1,N,1); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...