Advertisement
Matheus2014

pastas

Feb 13th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.47 KB | None | 0 0
  1. lista=raw_input().split()
  2.  
  3. p=int(lista[0])
  4. n=int(lista[1])
  5.  
  6. i=0
  7. valores=[]
  8.  
  9. while i<n:
  10.     valores.append(int(input()))
  11.     i+=1
  12.  
  13. valores.sort()
  14. res="S"
  15.  
  16. num_testar=1
  17.  
  18. i=1
  19. num_posicao=1
  20. while i<=n:
  21.     if num_testar not in valores:
  22.         res="N"
  23.         break
  24.     del valores[valores.index(num_testar)]
  25.     #print valores
  26.     if num_posicao==p:
  27.         num_posicao=0
  28.         num_testar=0
  29.     num_testar+=1
  30.     i+=1
  31.     num_posicao+=1
  32. print res
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement