Submission #773981

#TimeUsernameProblemLanguageResultExecution timeMemory
773981vjudge1Zagrade (COI20_zagrade)C++17
100 / 100
823 ms1440 KiB
#include <bits/stdc++.h> using namespace std; #define int long long //#define faster ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); char dizi[100005]; vector <string> x; vector <int> q; int sor(int x,int y){ cout<<"? "<<x<<" "<<y; cout<<endl; int m;cin>>m; return m; } int32_t main(){ // faster q.clear(); int n,k; cin>>n>>k; dizi[1]='('; q.push_back(1); for(int i=2;i<=n;i++){ if(q.size() && sor(q.back(),i)){ dizi[i]=')'; q.pop_back(); } else{ dizi[i]='('; q.push_back(i); } } int gc=q.size()/2; for(int i=0;i<=gc-1;i++){ dizi[q[i]]=')'; } cout<<"! "; for(int i=1;i<=n;i++)cout<<dizi[i]; 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...