Submission #56123

#TimeUsernameProblemLanguageResultExecution timeMemory
56123leejseoHotter Colder (IOI10_hottercolder)C++98
25 / 100
814 ms8312 KiB
#include "grader.h" #include <stdio.h> #include <algorithm> int HC(int N){ int lo = 1, hi = N; while (lo < hi){ if (hi == lo + 1){ Guess(lo); if (Guess(hi) == 1) return hi; return lo; } int mid = (lo + hi) >> 1; int left = Guess(lo); int middle = Guess(mid); if (middle == -1){ hi = mid; continue; } if (middle == 0){ return (lo+mid) >> 1; } int right = Guess(hi); //middle == 1 if (right == 1){ lo = mid; continue; } if (right == 0){ return (mid+hi)>>1; } if (right == -1){ lo = std::max(lo+1, ((lo + mid) >> 1)); hi = std::max(lo+1, ((hi + mid) >> 1)); continue; } } return lo; }

Compilation message (stderr)

hottercolder.cpp: In function 'int HC(int)':
hottercolder.cpp:13:7: warning: unused variable 'left' [-Wunused-variable]
   int left = Guess(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...