Medal Rankings by yvl

gets
h={}
3.times{|i|(h[split[i]]||=" 0"*3+$/)[i.id]+=1}while gets
$><<h.sort_by{|k,v|[v.sum,v]}.reverse

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return top