Cod sursa(job #932587)

Utilizator narcis_vsGemene Narcis - Gabriel narcis_vs Data 29 martie 2013 01:01:15
Problema Xerox Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.46 kb
#include <fstream>
#define In "xerox.in"
#define Out "xerox.out"
using namespace std;
ifstream fin(In);

inline bool NIM()
{
    int n,m,x,y,sum=0;
    fin>>n>>x>>y;
    while(n--)
    {
        fin>>m;
        sum^=m;
        while(m--)
            fin>>x>>y;
    }
    return sum;
}

int main()
{
    int T;
    fin>>T;
    ofstream fout(Out);
    while(T--)
        fout<<NIM()<<"\n";
    fin.close();
    fout.close();
    return 0;
}