Cod sursa(job #2614346)

Utilizator CraniXortDumitrescul Eduard CraniXort Data 11 mai 2020 17:11:02
Problema Xerox Scor 100
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.58 kb
#include <bits/stdc++.h>

std::ifstream fin ("xerox.in");
std::ofstream fout ("xerox.out");

int main(){
    /*
    int sg[205];
    sg[0] = 0;
    for (i=1; i<=200; i++){
        bool ok[205] = {};

    }
    */
    int Q;
    fin >> Q;
    while (Q--){
        int n, aux, nr, i, s=0;
        fin >> n >> aux >> aux;
        for (i=0; i<n; i++){
            fin >> nr;
            for (int j=0; j<nr; j++)
                fin >> aux >> aux;
            s = s ^ nr;
        }
        if (s) fout << "1\n";
        else fout << "0\n";

    }

    return 0;
}