Cod sursa(job #2902915)

Utilizator cezar.balutaCezar Baluta cezar.baluta Data 16 mai 2022 22:20:44
Problema Xerox Scor 100
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.48 kb
#include <iostream>
#include <fstream>

using namespace std;

int main() {
    ifstream in("xerox.in");
    ofstream out("xerox.out");
    int n,m,x,rez = 0,t;
    in>>t;
    for(int i=0;i<t;i++) {
        rez = 0;
        in >> n;
        in>>x>>x;
        for (int j = 0; j < n; j++) {
            in >> m;
            rez ^= m;
            while (m--)
                in >> x >> x;
        }
        if(rez)
            out<<1<<'\n';
        else out<<0<<'\n';
    }

    return 0;
}