Cod sursa(job #1067428)

Utilizator petretiberiu46Petre Tiberiu petretiberiu46 Data 26 decembrie 2013 20:13:47
Problema Xerox Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.64 kb
#include <fstream>
#include <iostream>

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

int main()
{
    int t, n, m, dx, dy, x, y, xor_x=0, xor_y=0, xor_f=0;
    bool ok;
    f>>t;
    while(t--)
    {
        f>>n>>dx>>dy;
        while(n--)
        {
            f>>m;
            for(int i = 1; i<=m; i++)
            {
                f>>x>>y;
                xor_x ^= x;
                xor_y ^= y;
            }
            xor_f = xor_x^xor_y;
        }
        if(xor_f)
        {
            ok = 1;
        }
        else
        {
            ok = 0;
        }
    }
    g<<ok;
}