Submission #1015900

#TimeUsernameProblemLanguageResultExecution timeMemory
1015900warrennZagrade (COI20_zagrade)C++14
71 / 100
565 ms1560 KiB
#include<bits/stdc++.h> using namespace std; #define int long long signed main(){ int n,q; cin>>n>>q; stack<int>isi; char jwb[n+1]; for(int d=1;d<=n;d++){ if(isi.empty()){ isi.push(d); jwb[d]='('; } else{ cout<<"? "<<isi.top()<<" "<<d<<endl; int w; cin>>w; if(w==0){ isi.push(d); jwb[d]='('; } else{ isi.pop(); jwb[d]=')'; } } } int ganti=isi.size()/2; while(!isi.empty()){ if(ganti==0){ jwb[isi.top()]='('; } else{ ganti--; } isi.pop(); } cout<<"! "; for(int d=1;d<=n;d++){ cout<<jwb[d]; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...