Submission #59239

#TimeUsernameProblemLanguageResultExecution timeMemory
59239TAMREFHotter Colder (IOI10_hottercolder)C++11
50 / 100
806 ms8288 KiB
#include "grader.h" #include <bits/stdc++.h> using namespace std; int HC(int N){ int b[2] = {1,N}; Guess(b[1]); for(int w = 0, r; b[0] < b[1]; w ^= 1){ r = Guess(b[w]); //printf("N = %d, [%d, %d], res = %d\n",N,b[w],b[!w],r); if(!r) return (b[0] + b[1]) / 2; if(r == -1){ if(b[1] - b[0] == 1) return b[!w]; Guess(b[!w]); b[w] = (b[0] + b[1] + !w) / 2; w = !w; } else{ if(b[1] - b[0] == 1) return b[w]; b[!w] = (b[0] + b[1] + w) / 2; } } return b[0]; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...