Cod sursa(job #966234)

Utilizator AlexandruValeanuAlexandru Valeanu AlexandruValeanu Data 25 iunie 2013 15:33:54
Problema Xerox Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.51 kb
#include <iostream>
#include <fstream>

using namespace std;

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

    int T, N, M, DX, DY, sum = 0, val, x, y;

    for ( f >> T; T; T-- )
    {
        f >> N >> DX >> DY;

        for ( ; N; N-- )
        {
            f >> M;

            sum ^= M;

            for ( ; M; M-- )
                f >> x >> y;
        }

        if ( sum )
            g << "1\n";
        else
            g << "0\n";
    }

    return 0;
}