fork download
f=lambda r:100*sum(c/3*((v<2)*9+v)+c%3*(v<2or(v==5)/2.)for v,c in enumerate(map(r.count,range(7))))
tests = [[[1, 2, 3, 4, 5, 6], 150],[[1, 1, 1, 2, 3, 5], 1050],[[1, 1, 1, 1, 1, 1], 2000],[[2, 2, 2, 2, 2, 2], 400],[[6, 6, 1, 5, 5, 6], 800],[[2, 3, 4, 6, 2, 4], 0],[[1, 5, 1, 5, 1, 5], 1500],[[5, 5, 5, 5, 2, 3], 550],[[1, 1, 1, 1, 1, 5], 1250],[[3, 3, 4, 4, 3, 4], 700]]
for test, expected in tests:
	result = f(test)
	print test, result, result==expected
Success #stdin #stdout 0.01s 9024KB
stdin
Standard input is empty
stdout
[1, 2, 3, 4, 5, 6] 150.0 True
[1, 1, 1, 2, 3, 5] 1050.0 True
[1, 1, 1, 1, 1, 1] 2000.0 True
[2, 2, 2, 2, 2, 2] 400.0 True
[6, 6, 1, 5, 5, 6] 800.0 True
[2, 3, 4, 6, 2, 4] 0.0 True
[1, 5, 1, 5, 1, 5] 1500.0 True
[5, 5, 5, 5, 2, 3] 550.0 True
[1, 1, 1, 1, 1, 5] 1250.0 True
[3, 3, 4, 4, 3, 4] 700.0 True