# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
373613 | 2021-03-05T09:29:08 Z | wind_reaper | Zagrade (COI20_zagrade) | C++17 | 1 ms | 384 KB |
#include <bits/stdc++.h> using namespace std; int32_t main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); int n, q; cin >> n >> q; vector<char> ans(n, '.'); vector<int> stack; for(int i = 0; i < n; i++){ if(stack.empty()){ stack.push_back(i); continue; } cout << stack.back() + 1 << ' ' << i + 1 << endl; bool v; cin >> v; if(v){ ans[stack.back()] = '(', ans[i] = ')'; stack.pop_back(); } else stack.push_back(i); } for(int i = 0; i < stack.size() / 2; i++) ans[i] = ')'; for(int i = stack.size()/2; i < stack.size(); i++) ans[i] = '('; cout << "! "; for(int i = 0; i < n; i++) cout << ans[i]; return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 384 KB | Execution killed with signal 13 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 364 KB | Execution killed with signal 13 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 364 KB | Execution killed with signal 13 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 384 KB | Execution killed with signal 13 |
2 | Halted | 0 ms | 0 KB | - |