#include "grader.h"
int HC(int n){
int ini = 1, fim = n , meio, ans = -1;
while(ini<=fim){
meio = (ini + fim) >> 1;
if(ini == fim){
ans = meio;
break;
}
Guess(ini);
int a = Guess(fim);
if(a == 0){
ans = meio;
break;
}
else if(a == 1){
ini = meio + 1;
}
else{
fim = meio - 1 + (fim - ini)%2;
}
}
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
27 ms |
1272 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
27 ms |
1272 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
29 ms |
1272 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
731 ms |
8280 KB |
Output is partially correct - alpha = 0.068965517241 |