This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#include "grader.h"
//~ #include "grader.cpp"
using namespace std;
map <int, int> m;
int HC(int N){
if(N == 1) return 1;
auto guess = [&](int x){
if(x < 1 || x > N) return -1;
return Guess(x);
};
int l = 1, r = N;
while(l + 1 < r){
int mid = (l + r) / 2;
guess(mid);
int x = guess(mid - 1);
if(x == 1) r = mid;
else l = mid;
}
guess(l);
int x = guess(l + 1);
if(x == -1) return l;
return l + 1;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |