답안 #1052325

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1052325 2024-08-10T13:23:51 Z VMaksimoski008 Zagrade (COI20_zagrade) C++17
0 / 100
493 ms 600 KB
#include <bits/stdc++.h>
//#define int long long

using namespace std;

using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

const int mod = 1e9 + 7;
const int LOG = 20;
const int maxn = 1e5 + 5;

int query(int a, int b) {
    cout << "? " << a << " " << b << endl;
    int x; cin >> x;
    return x;
}

signed main() {
    int n, q;
    cin >> n >> q;

    vector<int> t(n+1);
    for(int i=1; i+1<=n; i++) t[i+1] = t[i] ^ query(i, i+1);
 
    cout << "! ";
    for(int i=1; i<=n; i++) cout << (t[i] ? ')' : '(');
    cout << endl;
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 5 ms 344 KB Mismatch at position 3. Expected (, found )
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB Mismatch at position 1. Expected ), found (
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 493 ms 600 KB Mismatch at position 3. Expected (, found )
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB Mismatch at position 1. Expected ), found (
2 Halted 0 ms 0 KB -