# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1004075 | vjudge1 | Zagrade (COI20_zagrade) | C++17 | 576 ms | 1232 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |