Submission #837979

#TimeUsernameProblemLanguageResultExecution timeMemory
8379791075508020060209tcColors (BOI20_colors)C++14
9 / 100
1 ms288 KiB
#pragma GCC optimize("O3,unroll-loops") #pragma GCC target("avx,popcnt,sse4,abm") #include <bits/stdc++.h> using namespace std; int n; int ask(int v){ cout<<"? "<<v<<endl; int ret; cin>>ret; return ret; } void solve64(){ ask(1); int lst=1; int lit=2;int rit=n; for(int i=1;i<=64;i++){ if(i%2==1){ int v=rit; if(v==lst){ cout<<"= 1"<<endl;exit(0); } int vl=ask(rit--); if(vl==0){ cout<<"= "<<abs(v-lst)+1<<endl;exit(0); } lst=v; }else{ int v=lit; if(v==lst){ cout<<"= 1"<<endl;exit(0); } int vl=ask(lit++); if(vl==0){ cout<<"= "<<abs(v-lst)+1<<endl;exit(0); } lst=v; } } } signed main(){ cin>>n; if(n<=64){ solve64(); } }
#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...