Cod sursa(job #125355)

Utilizator VmanDuta Vlad Vman Data 20 ianuarie 2008 12:39:39
Problema Xerox Scor 0
Compilator cpp Status done
Runda preONI 2008, Runda 3, Clasele 11-12 Marime 0.42 kb
#include <stdio.h>

int N,M[1000],T,x,y,s,i;

int main()
{
 freopen("xerox.in","r",stdin);
 freopen("xerox.out","w",stdout);
 scanf("%d",&T);
 while (T)
 {
 --T;
 scanf("%d %d %d",&N,&x,&y);
 for (i=1;i<=N;++i)
      scanf("%d %d %d",&M[i],&x,&y);
 s=0;
 if (N&1) s=1;
   else
    for (i=1;i<N;++i)
     if (M[i]!=M[i+1]) { s=1;break; }
 printf("%d\n",s);
 }
 fclose(stdin);
 fclose(stdout);
 return 0;
}