DeukausGames

Interruptor OBI

Aug 23rd, 2018
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.34 KB | None | 0 0
  1. # interruptor
  2. # obi 2016
  3. # nivel junior f1
  4. # https://olimpiada.ic.unicamp.br/pratique/pj/2016/f1/lampadas/
  5.  
  6. n = int(input())
  7. c = input().split(" ")
  8. c1 = list(map(int,c))
  9. A = c1.count(1)
  10. A += c1.count(2)
  11. B = 0
  12. B += c1.count(2)
  13.  
  14. if A % 2 == 0:
  15.     print(0)
  16. else:
  17.     print(1)
  18.  
  19. if B % 2 == 0:
  20.     print(0)
  21. else:
  22.     print(1)
Advertisement
Add Comment
Please, Sign In to add comment