Submission #119528

#TimeUsernameProblemLanguageResultExecution timeMemory
119528PlurmHotter Colder (IOI10_hottercolder)C++11
50 / 100
2557 ms8440 KiB
#include "grader.h" #include <cstdlib> #include <ctime> int HC(int N){ srand(time(NULL)); int lo = 1; int hi = N; int last = -1; while(lo < hi){ if(last == lo){ int r = Guess(hi); last = hi; if(r > 0){ lo = (lo + hi) / 2 + 1; }else{ hi = (lo + hi) / 2; } }else if(last == hi){ int r = Guess(lo); last = lo; if(r < 0){ lo = (lo + hi) / 2 + 1; }else{ hi = (lo + hi) / 2; } }else{ if(rand() % 2){ last = lo; Guess(lo); }else{ last = hi; Guess(hi); } } } return lo; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...