Submission #891221

#TimeUsernameProblemLanguageResultExecution timeMemory
891221HasanV11010238Hotter Colder (IOI10_hottercolder)C++17
0 / 100
472 ms149952 KiB
#include "grader.h" int HC(int N){ int l = 1, r = N, las; int mid = (N + 1) / 2; if (N == 1){ return 1; } else if (N == 2){ Guess(1); int g = Guess(2); if (g > 0){ return 2; } return 1; } int g = Guess(mid - 1); las = mid - 1; while (l != r){ mid = (l + r) / 2; if (mid == las){ mid += 1; } g = Guess(mid); if (g > 0){ if (las < mid){ if (l == mid){ l = mid + 1; } else{ l = mid; } } else{ r = mid; } } else if (g < 0){ if (las < mid){ r = mid; } else{ if (l == mid){ l = mid + 1; } else{ l = mid; } } } else{ return (mid + las) / 2; } las = mid; } return l; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...