Cod sursa(job #976120)

Utilizator manutrutaEmanuel Truta manutruta Data 22 iulie 2013 16:33:19
Problema Xerox Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.46 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 >> x >> y;
            s ^= m;
        }

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