Ranking by 51b

t[900],*q=t,*r,m,*p;f(int*a,int*b){return*b-*a?:b[1]%107-a[1]%107;}main(n){for(;gets(q+1);q+=8)for(*q=atoi(p=rindex(q+1,32)),*p=0,r=t;r<q;r+=8)!strcmp(r+1,q+1)?*r<*q?*r=*q:0,r=q-=8:0;for(qsort(r=t,q-t>>3,32,f);r<q;r+=8,n++)printf("%d %s %d\n",m=*r-r[-8]?n:m,r+1,*r);}

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

download

return to the top page