Cod sursa(job #3346205)

Utilizator MihaiZ777MihaiZ MihaiZ777 Data 12 martie 2026 20:39:35
Problema Xerox Scor 0
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 1.51 kb
#include <bits/stdc++.h>
using namespace std;

#define FAST_IO do {ios::sync_with_stdio(false); cin.tie(nullptr);} while(0)
#define ALL(x)  (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define VEC_READ(v, n)                   \
    for (int i = 0; i < (n); i++) {      \
        cin >> v[i];                     \
    }
#define VEC_PRINT(v, n, sp)              \
    for (int i = 0; i < (n); i++) {      \
        cout << v[i] << sp;              \
    }                                    \
    cout << '\n';
#define RVEC_PRINT(v, n, sp)             \
    for (int i = (n) - 1; i >= 0; i--) { \
        cout << v[i] << sp;              \
    }                                    \
    cout << '\n';

using ll = long long;
using ull = unsigned long long;
using ld = long double;

const int kInf = 0x3f3f3f3f;
const ll kInfLL = 0x3f3f3f3f3f3f3f3f;

void Solve() {
    int n, x, y;
    cin >> n >> x >> y;

    bool allOne = true;
    int a, b, c;
    
    for (int i = 0; i < n; i++) {
        cin >> a;
        if (a != 1) allOne = false;
        for (int j = 0; j < a; j++) {
            cin >> b >> c;
        }
    }

    if (allOne && n % 2 == 0) {
        cout << 0 << '\n';
    } else {
        cout << 1 << '\n';
    }
}

int main() {
// #ifdef DEBUG
    freopen("xerox.in", "r", stdin);
    freopen("xerox.out", "w", stdout);
// #endif

    // FAST_IO;

    int tcases = 1;
    cin >> tcases;

    while (tcases--) {
        Solve();
    }
    return 0;
}