Cod sursa(job #2977502)

Utilizator francescom_481francesco martinut francescom_481 Data 11 februarie 2023 18:29:36
Problema Xerox Scor 0
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.49 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;

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