Advertisement
Guest User

Untitled

a guest
Apr 8th, 2020
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.26 KB | None | 0 0
  1. nums = [[0, 0], [0, 0]]
  2. count = 0
  3.  
  4. n = int(input())
  5. a = int(input())
  6. for i in range(n - 1):
  7.     nums[a % 2][not bool(a % 3)] += 1
  8.     a = int(input())
  9.     count += nums[not a % 2][not a % 3]
  10.     if not a % 3:
  11.         count += nums[not a % 2][1]
  12.     print(count)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement