Submission #341924

#TimeUsernameProblemLanguageResultExecution timeMemory
341924a_playerColors (BOI20_colors)C++14
9 / 100
2 ms512 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; int query(ll a){ cout<<"? "<<a<<endl; int b; cin>>b; return b; } void answer(ll a){ cout<<"= "<<a<<endl; exit(0); } int main(){ int N; cin>>N; if(N>64)return 0; int ans=query(1); ans=query(N); if(ans==0)answer(N); int last=N-1; for(int i=2,j=N-1;last>1;i++,j--){ ans=query(i); if(ans==0)answer(last); last--; if(last<=1)break; ans=query(j); if(ans==0)answer(last); last--; } answer(1); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...