# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
780784 | 2023-07-12T13:06:53 Z | devariaota | Zagrade (COI20_zagrade) | C++17 | 1 ms | 296 KB |
#include <bits/stdc++.h> #define LL long long using namespace std; LL jawab; void tanya(LL x,LL y) { cout<<">>> ? "<<x<<" "<<y<<endl; cin>>jawab; } int main() { LL n,q; scanf("%lld %lld",&n,&q); vector<LL>v; char arr[n+5]; for(LL a=1;a<=n;a++) { arr[a]='*'; } LL buka=0,tutup=0; for(LL a=1;a<=n;a++) { if(v.size()==0) { v.push_back(a); continue; } tanya(v[v.size()-1],a); if(!jawab) { v.push_back(a); } else { arr[v[v.size()-1]]='('; arr[a]=')'; tutup++; v.pop_back(); } } LL bagi=n/2; for(LL a=1;a<=n;a++) { // printf("%lld %lld %lld\n",buka,tutup,bagi); if(arr[a]=='*') { if(tutup<bagi) { arr[a]=')'; tutup++; } else arr[a]='('; } } cout<<">>> ! "; for(LL a=1;a<=n;a++)cout<<arr[a]<<" "; cout<<endl; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 0 ms | 208 KB | Execution killed with signal 13 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 296 KB | Execution killed with signal 13 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 0 ms | 208 KB | Execution killed with signal 13 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 208 KB | Execution killed with signal 13 |
2 | Halted | 0 ms | 0 KB | - |