Submission #642825

# Submission time Handle Problem Language Result Execution time Memory
642825 2022-09-20T15:20:28 Z maryoyoyo Zagrade (COI20_zagrade) C++17
0 / 100
0 ms 208 KB
#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'; 
}
# 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 0 ms 208 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 0 ms 208 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -