fork(1) download
  1. # http://c...content-available-to-author-only...e.com/a/90683/34718
  2.  
  3. def f(L):s=n=0;exec"n+=1\nwhile L.count(n)>2:s+=[n*100,1e3][n<2];exec'L.remove(n);'*3\n"*6;C=L.count;print s+100*C(1)+50*C(5)
  4.  
  5. f([1, 2, 3, 4, 5, 6]) #-> 150
  6. f([1, 1, 1, 2, 3, 5]) #-> 1050
  7. f([1, 1, 1, 1, 1, 1]) #-> 2000
  8. f([2, 2, 2, 2, 2, 2]) #-> 400
  9. f([6, 6, 1, 5, 5, 6]) #-> 800
  10. f([2, 3, 4, 6, 2, 4]) #-> 0
  11. f([1, 5, 1, 5, 1, 5]) #-> 1500
  12. f([5, 5, 5, 5, 2, 3]) #-> 550
  13. f([1, 1, 1, 1, 1, 5]) #-> 1250
  14. f([3, 3, 4, 4, 3, 4]) #-> 700
  15.  
Success #stdin #stdout 0.01s 9024KB
stdin
Standard input is empty
stdout
150
1050.0
2000.0
400
800
0
1500.0
550
1250.0
700