# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
232005 | 2020-05-15T16:56:43 Z | Coroian_David | Hotter Colder (IOI10_hottercolder) | C++11 | 0 ms | 0 KB |
#include "grader.h" int cautBin() { ///VARIANTA CEA MAI PENALA DOAMNE ///Guess(st) and Guess(dr) fail because when we have 1 500 and 250 or 1 6 and 3 /// it will not give the right number, it makes no use of the same answer int st = 1; int dr = DR; while(st < dr) { if(st == 1 && dr == 2) { Guess(1); int x = Guess(2); return (x == 1 ? 2 : 1); } int mid = (st + dr) >> 1; Guess(mid - 1); int x = Guess(mid + 1); if(x == 0) return mid; if(x == 1) st = mid + 1; else dr = mid - 1; } return st; }