#include "grader.h"
#include <bits/stdc++.h>
using namespace std;
int HC(int n){
array<int, 2> lim;
lim[0] = 1, lim[1] = n;
Guess(lim[0]);
int turn = 1;
while(lim[0] < lim[1]){
int mid = (lim[0] + lim[1]) >> 1;
int r = Guess(lim[turn]);
if(r == 1){
if(turn == 0)
lim[1] = mid;
else lim[0] = mid + 1;
}
else if(r == -1){
if(turn == 0)
lim[0] = mid + 1;
else lim[1] = mid;
}
else{
return mid;
}
turn ^= 1;
}
return lim[0];
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
40 ms |
13676 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
41 ms |
13676 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
41 ms |
13824 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
746 ms |
135956 KB |
Output isn't correct - alpha = 0.000000000000 |