Advertisement
DialOG_

Untitled

Mar 7th, 2021
607
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.39 KB | None | 0 0
  1. o0=o1=o2=o3=o4=o5=0
  2.  
  3. f = open('fileB.txt')
  4.  
  5. n = int(f.readline())
  6.  
  7. for i in range(n):
  8.     x = int(f.readline())
  9.     if x % 6 == 0:
  10.         o0+=1
  11.     if x % 6 == 1:
  12.         o1+=1
  13.     if x % 6 == 2:
  14.         o2+=1
  15.     if x % 6 == 3:
  16.         o3+=1
  17.     if x % 6 == 4:
  18.         o4+=1
  19.     if x % 6 == 5:
  20.         o5+=1
  21.  
  22. s = (n*(n-1)//2)-(o1*o5+o2*o4+o0*(o0-1)//2+o3*(o3-1)//2)
  23.  
  24. print(s)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement