Cod sursa(job #976128)

Utilizator manutrutaEmanuel Truta manutruta Data 22 iulie 2013 16:37:01
Problema Xerox Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.56 kb
#include <iostream>
#include <fstream>
using namespace std;

ifstream f("xerox.in");
ofstream g("xerox.out");

int t;
int n;
int m, x, y;
int s;

int main()
{
    f >> t;

    for (int i = 1; i <= t; i++) {
        f >> n >> x >> y;

        s = 0;
        for (int j = 1; j <= n; j++) {
            f >> m;
            s ^= m;
            for (int k = 1; k <= m; k++) {
                f >> x >> y;
            }
        }

        if (s == 0)
            g << 0 << '\n';
        else
            g << 1 << '\n';
    }
    return 0;
}