Advertisement
Manioc

pastas

Dec 10th, 2017
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.48 KB | None | 0 0
  1. def resp():
  2.     completos = n/p
  3.     resto = n%p
  4.     for i in range(1, p+1):
  5.         if resto:
  6.             if lista[i] != (completos + 1):
  7.                 print "N"
  8.                 return 0;
  9.             resto -= 1
  10.         else:
  11.             if lista[i] != completos:
  12.                 print "N"
  13.                 return 0;
  14.     print "S"
  15.  
  16. p, n = map(int, raw_input().split())
  17.  
  18. lista = [0 for i in range(p+1)]
  19. for i in range(n):
  20.     val = int(raw_input())
  21.     lista[val] += 1
  22.  
  23. resp()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement