Cod sursa(job #1867758)

Utilizator BeatriceBBeatrice Roxana BeatriceB Data 4 februarie 2017 12:18:24
Problema Xerox Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.58 kb
#include <iostream>
#include <fstream>
using namespace std;
ifstream f("xerox.in");
ofstream g("xerox.out");
int T, N, DX, DY, x, y, M, xorsum;
int main()
{
    f>>T;
    for(int k=1; k<=T; k++)
    {
        f>>N>>DX>>DY;
        xorsum=0;
        for(int i=1; i<=N; i++)
        {
            f>>M;
            for(int j=1; j<=M; j++)
                f>>x>>y;
            xorsum=xorsum^M;
        }
        if(xorsum)
            g<<"1"<<'\n';   //N-position
        else
            g<<"0"<<'\n';   //P-positon
    }
    f.close();
    g.close();
    return 0;
}