Submission #41038

#TimeUsernameProblemLanguageResultExecution timeMemory
41038hsb154Hotter Colder (IOI10_hottercolder)C++14
50 / 100
745 ms8288 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; if (left != right) { temp = Guess(left); } flag = true; } else {//이전에 left수정 right = (left + right) / 2; if (left != right) { temp = Guess(right); } flag = false; } } else if (temp == -1) { if (!flag) {//이전에 right 수정 right = (left + right) / 2; if (left != right) { temp = Guess(left); temp = Guess(right); } flag = false; } else {//이전에 left 수정 left = (left + right) / 2 + 1; if (left != right) { 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...