Cod sursa(job #3310480)

Utilizator 0021592Grecu rares 0021592 Data 14 septembrie 2025 11:23:59
Problema Xerox Scor 100
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.65 kb
#include <fstream>
#include <cstring>
using namespace std;
ifstream in("xerox.in");
ofstream out("xerox.out");
int t, n, m, x, a, b, y = -1, x1;
string s;
int main()
{
    in >> t;
    while(t)
    {
        --t;
        in >> n >> a >> b;
        while(n)
        {
            --n;
            in >> m;
            if (y == -1)
                y = m;
            else
                y ^= m;
            while(m)
            {
                --m;
                in >> x >> x1;
            }
        }
        if (y == 0)
            out << 0 << '\n';
        else
            out << 1 << '\n';
        y=-1;
    }
    return 0;
}