Cod sursa(job #2788283)

Utilizator MatteoalexandruMatteo Verzotti Matteoalexandru Data 25 octombrie 2021 14:32:18
Problema Xerox Scor 100
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 1.37 kb
/*
                `-/oo+/-   ``
              .oyhhhhhhyo.`od
             +hhhhyyoooos. h/
            +hhyso++oosy- /s
           .yoooossyyo:``-y`
            ..----.` ``.-/+:.`
                   `````..-::/.
                  `..```.-::///`
                 `-.....--::::/:
                `.......--::////:
               `...`....---:::://:
             `......``..--:::::///:`
            `---.......--:::::////+/`
            ----------::::::/::///++:
            ----:---:::::///////////:`
            .----::::::////////////:-`
            `----::::::::::/::::::::-
             `.-----:::::::::::::::-
               ...----:::::::::/:-`
                 `.---::/+osss+:`
                   ``.:://///-.
*/
#include <bits/stdc++.h>
#define debug(x) cerr << #x << " " << x << '\n'
#define debugsp(x) cerr << #x << " " << x << ' '

using namespace std;

ifstream in ("xerox.in");
ofstream out ("xerox.out");

const int INF = 2e9;

void Solve () {
    int n, useless, ans;
    ans = 0;
    in >> n >> useless >> useless;
    while (n--) {
        int x;
        in >> x;
        ans ^= x;
        while (x--)
            in >> useless >> useless;
    }

    if (ans) out << "1\n";
    else out << "0\n";
}

int main() {
    int t;
    in >> t;
    
    while (t--)
        Solve();
    in.close();
    out.close();
    return 0;
}