Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. import sys
  2. input = sys.stdin.readline
  3.  
  4. def xor(a, b):
  5. c = ''
  6. for i in range(len(a)):
  7. c += '0' if a[i] == b[i] else '1'
  8. return c
  9.  
  10. R = int(input())
  11. C = int(input())
  12. light = ["".join(input().split()) for i in range(R)]
  13. r1 = set()
  14. r1.add(light[0])
  15. for i in range(1, R):
  16. cur = set()
  17. cur.add(light[i])
  18. for j in r1:
  19. cur.add( xor(j, light[i] ))
  20. r1 = cur
  21. print(len(r1))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement