|
||||||||||
Another ContestTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/65536 K (Java/Others)Total Submission(s): 751 Accepted Submission(s): 273 Problem Description The contest is beginning again! To make the contest more interesting, Competition Commission has developed a new rule: There are N problems initially, and for each problem, if one get an "Accepted", he can get some points, equal to the number of contestants that did not solve the problem. The score of each contestant was equal to the sum of points assigned to the problems solved by that contestant. iSea participated in the contest, but he is confused by the complicated scoring rules, and now he is staring at the results, unable to determine his place in the final standings. Help iSea by writing a program that calculates his score and his ranking. Before the contest, the contestants were assigned unique IDs from 1 to S inclusive, and iSea's ID was P. The final standings of the competition list the contestants in descending order of their scores. In case of a tie, among the tied contestants, those who have solved more tasks will be listed ahead of those who have solved fewer tasks. In case of a tie by this criterion as well, the contestants with equal results will be listed in ascending order of their IDs. Input There are several test cases in the input. The first line of each case contains three integers N, S, P (0 < N, S <= 1000, 1 <= P <= S), their meaning are the same as the description. Then N lines follows, each line contains S integers, whether 0 or 1, indicating the result of S contestants solving the N problems, 0 means this contestant haven¡¯t solved this problem, 1 means solved. The input terminates by end of file marker. Output For each test case, output two integers, indicating iSea¡¯s scores and ranking. Sample Input
Sample Output
Author iSea@WHU Source | ||||||||||
|