# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1030348 | sleepntsheep | Colors (BOI20_colors) | 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>
#include<stdlib.h>
int a_;
int ask(int c){printf("? %d\n",c);fflush(stdout);scanf("%d",&a_);return a_;}
void report(int C){printf("= %d\n", C);fflush(stdout);exit(0);}
int main(){
long long n;
scanf("%lld",&n);
if(n==1)report(1);
ask(1);
if(!ask(n))report(n);
for(int r=n-1,l=2,d=n-1,i=1,cc=0;cc<n-2;++i,--d,++cc)
if(i%2&&!ask(l++))report(d);
else if(i%2==0&&!ask(r--))report(d);
report(1);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |