Submission #1074589

#TimeUsernameProblemLanguageResultExecution timeMemory
1074589clementineHotter Colder (IOI10_hottercolder)C++17
50 / 100
491 ms8028 KiB
#include "grader.h" #include <bits/stdc++.h> using namespace std; int HC(int N){ int l = 1; int r = N; bool changed = 0; int b , a; while(l != r) { int mid = (l + r) / 2; if(changed == 1) { b = Guess(r); a = Guess(l); } else { a = Guess(l); b = Guess(r); } //cout << a << " " << b << " " <<l << " " <<r << '\n'; if((changed == 1 && a==0) || (changed ==0 && b ==0)) { //cout << mid << "ignore rest \n"; return mid; break; } else if((changed ==0 && b ==1) || (changed == 1 && a == -1)) { l = mid + 1; changed = 0; } else { r = mid; changed = 1; } } //cout << l; return l; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...