# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
973923 | sleepntsheep | Guess the number (BOI20_guess) | C11 | 1 ms | 596 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.
#include<stdio.h>
int n;
int main()
{
scanf("%d",&n);
int lb=0,ub=n+1;
while(ub-lb>1)
{
int mid=lb+(ub-lb)/2,x;
printf("? %d\n",mid);fflush(stdout);
scanf("%d",&x);
if(x==0)return printf("= %d\n",mid),fflush(stdout),0;
if(x<0)lb=mid;
else ub=mid;
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |