Cod sursa(job #2977512)

Utilizator francescom_481francesco martinut francescom_481 Data 11 februarie 2023 18:43:31
Problema Xerox Scor 100
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.66 kb
#include <bits/stdc++.h>

using namespace std;

ifstream fin("xerox.in");
ofstream fout("xerox.out");
#define cin fin
#define cout fout

#define N 5005
int t, n, x, a, y, b;

int main()
{
    cin >> t;
    for( ; t ; t--)
    {
        cin >> n >> a >> b;
        cin >> x;
        for(int i = 1 ; i <= x ; i++)
        {
            cin >> a >> b;
        }
        for(int i = 2 ; i <= n ; i++)
        {
            cin >> y;
            for(int j = 1 ; j <= y ; j++)
            {
                cin >> a >> b;
            }
            x ^= y;
        }
        if(x == 0)cout << "0\n";
        else cout << "1\n";
    }
    return 0;
}