Advertisement
Kaidul

C

Mar 22nd, 2014
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4.     int i, j, n, s = 0, t, q;
  5.     scanf("%d", &n);
  6.     for(i=1; i<=n; i++)
  7.     {
  8.         for(j=1; j<i; j++)scanf("%*d");
  9.         scanf("%d", &t);
  10.         (s+=t)%=2;
  11.         for(j=i+1; j<=n; j++) scanf("%*d");
  12.     }
  13.     scanf("%d", &q);
  14.     for(i=1; i<=q; i++)
  15.     {
  16.         scanf("%d", &t);
  17.         if(t==3) printf("%d", s);
  18.         else
  19.         {
  20.             scanf("%*d");
  21.             s = 1-s;
  22.         }
  23.     }
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement