fork download
  1. pole = [1,2,1,2,3,5,2,1,1,1,2,3,4,2,1]
  2. # N cisel z rozsahu 1 az M
  3.  
  4. #spocitaj pocetnosti cez vybrane podpostupnosti
  5. #zloz. N*M
  6. pocet = [len([x for x in pole if x==i ]) for i in range(1,6)]
  7. print(max(pocet))
  8.  
  9. #pocitaj priebezne
  10. #zloz. N+M
  11. pocet = [0]*len(pole)
  12. for x in pole:
  13. pocet[x] = pocet[x]+1
  14. print(max(pocet))
  15.  
Success #stdin #stdout 0.02s 9992KB
stdin
Standard input is empty
stdout
6
6