Submission #41060

#TimeUsernameProblemLanguageResultExecution timeMemory
41060meyladyHotter Colder (IOI10_hottercolder)C++14
25 / 100
10006 ms8080 KiB
#include "grader.h" int HC(int N){ if (N == 1)return N; int left = 1; int right = N; Guess(1); if (N == 2) { if (Guess(2) == 1)return 2; return 1; } int mid = (left + right) / 2; while (left < right) { mid = (left + right) / 2; int query = Guess(mid); if (query == 1) {//hotter left = mid+1; } else if (query == -1) {//colder right = mid-1; } else {// same right = mid - 1; left = left + 1; } } Guess(right); while (right > 1) { if (Guess(right - 1) == -1)return right; right--; } return right; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...