#include <bits/stdc++.h>
#define ll long long
#define ii pair<int, int>
#define ld long double
using namespace std;
const int dv = 1e9 + 7;
const ld eps = 1e-18;
const int sz = 1e5;
int n, q;
bool cek;
string s;
int main() {
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
cin >> n >> q;
for(int i = 1; i <= n/2 + ((n/2)%2); i += 2) {
cout << "? " << i << ' ' << i+1 << '\n';
cout << flush;
cin >> cek;
if(cek) {
s = s + "()";
}
else {
s = s + "((";
}
}
for(int i = n/2 + ((n/2)%2); i <= n; i += 2) {
cout << "? " << i << ' ' << i + 1 << '\n';
cout << flush;
cin >> cek;
if(cek) {
s = s + "()";
}
else {
s = s + "))";
}
}
cout << "! " << s << '\n';
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
0 ms |
208 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
0 ms |
208 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
0 ms |
208 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
0 ms |
208 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |