Submission #1004075

#TimeUsernameProblemLanguageResultExecution timeMemory
1004075vjudge1Zagrade (COI20_zagrade)C++17
71 / 100
576 ms1232 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long int const N=2e5+5; int const mod=1e9+7; int main(){ int n,q; cin>>n>>q; int a=0; string s=""; vector<int> st; for(int i=0;i<n;i++){ if(st.size()==0){ st.push_back(i); s+='('; continue; } cout<<"? "<<(st.back())+1<<' '<<i+1<<endl; bool bl; cin>>bl; if(bl){ s+=')'; st.pop_back(); } else{ s+='('; st.push_back(i); } } cout<<"! "<<s<<endl; return 0; }

Compilation message (stderr)

zagrade.cpp: In function 'int main()':
zagrade.cpp:12:6: warning: unused variable 'a' [-Wunused-variable]
   12 |  int a=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...