Submission #41034

#TimeUsernameProblemLanguageResultExecution timeMemory
41034hsb154Hotter Colder (IOI10_hottercolder)C++14
25 / 100
783 ms8180 KiB
#include "grader.h" int HC(int N){ int left = 1; int right = N; Guess(1); int temp = Guess(N); bool flag = false; //false:right //true : left while(1){ if (left == right) return left; if (temp == 1) { if (!flag) {//이전에 right수정 left = (left + right) / 2+1; temp = Guess(left); flag = true; } else {//이전에 left수정 right = (left + right) / 2; temp = Guess(right); flag = false; } } else if (temp == -1) { if (!flag) {//이전에 right 수정 right = (left + right) / 2; temp = Guess(left); temp = Guess(right); flag = false; } else {//이전에 left 수정 left = (left + right) / 2 + 1; temp = Guess(right); temp = Guess(left); flag = true; } } else { return (left + right) / 2; } } /*for (int i = 1; i <= N; i++) { int temp = Guess(i); if (temp == -1) { return i - 1; } } return N;*/ }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...