Submission #1003897

#TimeUsernameProblemLanguageResultExecution timeMemory
1003897vjudge1Zagrade (COI20_zagrade)C++17
0 / 100
1 ms1112 KiB
#include <bits/stdc++.h> using namespace std; vector<int> v; stack<int> st; int main(){ int n,q; cin>>n>>q; v.resize(n+5); st.push(1); v[1] = 1; for(int i = 2; i <= n; i++){ cout<<"? "<<st.top()<<" "<<i<<endl; int x; cin>>x; if(x == 0){ v[i] = 1; st.push(i); }else{ v[i] = 0; st.pop(); } } cout<<"! "; for(int i = 1; i <= n; i++){ if(v[i] == 0)cout<<")"; else cout<<"("; }cout<<endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...