# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1096276 | laure | Colors (BOI20_colors) | C++14 | 1 ms | 448 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>
#define int long long
using namespace std;
signed main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n;
cin>>n;
int p=1,c=n,x;
cout<<"? 1"<<endl;
cin>>x;
cout<<"? "<<n<<endl;
cin>>x;
if(x)c--;
for(int i=2;i<=(n/2);i++)
{
cout<<"? "<<i<<endl;
cin>>x;
if(x)c--;
else break;
cout<<"? "<<n-i+1<<endl;
cin>>x;
if(x)c--;
else break;
}
if(n%2!=0&&c==2)
{
cout<<"? "<<n/2+1<<endl;
cin>>x;
if(x)c--;
}
cout<<"= "<<c<<endl;
}
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... |