# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
357668 | urd05 | Colors (BOI20_colors) | C++14 | 2 ms | 364 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 <bits/stdc++.h>
using namespace std;
int main(void) {
long long n;
scanf("%lld",&n);
long long l=2;
long long r=n;
long long now=1;
printf("? %lld\n",now);
fflush(stdout);
int got;
scanf("%d",&got);
long long ret=1;
for(int i=n-1;i>0;i--) {
if (now==l-1) {
now=r;
r--;
}
else {
now=l;
l++;
}
printf("? %lld\n",now);
fflush(stdout);
scanf("%d",&got);
if (got==0) {
ret=i+1;
break;
}
}
printf("= %lld\n",ret);
fflush(stdout);
}
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... |