Submission #336927

#TimeUsernameProblemLanguageResultExecution timeMemory
336927MrDominoZagrade (COI20_zagrade)C++14
0 / 100
1 ms512 KiB
#include <bits/stdc++.h> using namespace std; const int N = (int) 1e5 + 7; int n; int q; int a[N]; vector<int> stk; int main() { cin >> n >> q; for (int i = 1; i <= n; i++) { if (stk.empty()) { stk.push_back(i); a[i] = +1; continue; } int j = stk.back(); cout << j << " " << i << endl; int ret; cin >> ret; if (ret) { stk.pop_back(); a[i] = -1; } else { stk.push_back(i); a[i] = +1; } } cout << "! "; for (int i = 1; i <= n; i++) { if (a[i] == +1) { cout << "("; } else { cout << ")"; } } cout << endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...