Cod sursa(job #2290945)

Utilizator Ruxandra985Nanu Ruxandra Laura Ruxandra985 Data 27 noiembrie 2018 10:49:28
Problema Xerox Scor 100
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.56 kb
#include <cstdio>

using namespace std;

int main()
{
    FILE *fin=fopen ("xerox.in","r");
    FILE *fout=fopen ("xerox.out","w");
    int t,n,dx,dy,sx,i,j,pc,x,y;
    fscanf (fin,"%d",&t);
    for (;t;t--){
        fscanf (fin,"%d%d%d",&n,&dx,&dy);
        sx=0;
        for (i=1;i<=n;i++){
            fscanf (fin,"%d",&pc);
            sx=(sx^pc);
            for (j=1;j<=pc;j++)
                fscanf (fin,"%d%d",&x,&y);
        }
        if (!sx)
            fprintf (fout,"0\n");
        else fprintf (fout,"1\n");
    }
    return 0;
}