| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1152587 | YSH2020 | Zagrade (COI20_zagrade) | C++20 | 0 ms | 416 KiB |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, q; cin >> n >> q;
int ans[n];
//suppose this is a valid bracket sequence.
for (int j = 0; j < n; j++) {
int started = 0;
for (int i = j+1; i <= n-1; i += 2) {
cout << "? " << ' ' << j+1 << ' ' << i+1 << '\n';
int x; cin >> x;
if (x == 1) {started = 1; break;}
}
if (started) ans[j] = 1;
else ans[j] = 0;
}
cout << "! ";
for (int i = 0; i < n; i++) {
if (ans[i] == 0) cout << '(';
else cout << ')';
}
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
