Submission #774172

#TimeUsernameProblemLanguageResultExecution timeMemory
774172vjudge1Zagrade (COI20_zagrade)C++17
71 / 100
818 ms944 KiB
#include <bits/stdc++.h> using namespace std; #define int long long #define OYY 10000000005 #define mod 1000000007 char dizi[100005]; vector <int> q; int sor(int x,int y){ cout<<"? "<<x<<" "<<y; cout<<'\n'; int m;cin>>m; return m; } int32_t main(){ 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 gec=q.size()/2; for(int i=0;i<gec;i++){ dizi[q[i]]='('; } cout<<"! "; for(int i=1;i<=n;i++)cout<<dizi[i]<<""; cout<<'\n'; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...