# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
642319 | cigneve | Guess the number (BOI20_guess) | C++14 | 0 ms | 208 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#pragma GCC optimize ("O3")
#include <stdio.h>
int main(){
int N,input=5;
scanf("%d",&N);
int l=1,r=N;
while (input!=0){
printf("? %d\n",(r-l)/2+l);
scanf("%d",&input);
if (input==1){
l=(r-l)/2+l;
}
else if (input==-1){
r=(r-l)/2+l;
}
}
printf("= %d",(r-l)/2+l);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |