Submission #55868

#TimeUsernameProblemLanguageResultExecution timeMemory
55868leejseoHotter Colder (IOI10_hottercolder)C++98
0 / 100
10046 ms8056 KiB
#include "grader.h" int HC(int N){ int lo = 1, hi = N, from=-1; while (lo < hi){ int m1 = (2*lo + hi)/3; int m2 = (lo + 2*hi)/3; if (from == -1){ HC(lo); int v1 = HC(m1); if (v1 == -1){ hi = m1; from = 1; // right continue; } if (v1 == 0) return (lo + m1) >> 1; lo = m1; from = 0; continue; } if (from){ int v2 = HC(m2); if (v2 == 0) return (m2 + hi) >> 1; if (v2 == -1){ lo = m2; from = 0; continue; } hi = m2; from = 1; continue; } int v1 = HC(m1); if (v1 == 0) return (lo + m1) >> 1; if (v1 == -1){ hi = m1; from = 1; continue; } lo = m1; from = 0; continue; } 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...