#include "grader.h"
int HC(int N){
int L=1;
int R=N-1;
bool f=false;
Guess(1);
while(L!=R){
if(f){
int t=Guess(L);
if(t>0){
L=(L+R+1)/2;
}
if(t==0)return (L+R)/2;
if(t<0){
R=(L+R-1)/2;
}
}
else{
int t=Guess(R);
if(t>0){
R=(L+R-1)/2;
}
if(t==0)return (L+R)/2;
if(t<0){
L=(L+R+1)/2;
}
}
f^=true;
}
return L;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
10008 ms |
262144 KB |
Time limit exceeded |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
10097 ms |
262144 KB |
Time limit exceeded |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
10005 ms |
262144 KB |
Time limit exceeded |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
10091 ms |
262144 KB |
Time limit exceeded |