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"
using namespace std;
//int Guess(int x) {
// cout << x << endl;
// int a;
// cin >> a;
// return a;
//}
int HC(int n) {
int l, r, last;
l = 1;
r = n;
Guess((l + r) / 2);
last = (l + r) / 2;
while(l < r) {
int mid = (l + r) / 2;
int x = Guess((l + mid) / 2);
if(x == 0) {
return (last + (l + mid) / 2) / 2;
} else if(x == 1) {
r = mid;
} else {
l = mid + 1;
}
}
return l;
}
//int main() {
// int n;
// cin >> n;
// cout << HC(n) << endl;
// return 0;
//}
# | 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... |