Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|

Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |

Language: Election
Description Given the voting preferences of a population of In this method, the first choices of the Input The input test file will contain multiple test cases. Each input test case begins with a single line containing the integers a_{i}_{1} a_{i}_{2} … a” where 1 ≤ _{iN}M ≤ 20 and _{i}a_{i}_{1}, …, a is a permutation of the integers 1, …, _{iN}N. M is the number of individuals in the _{i}ith group, and a_{i}_{1}, …, a is the ordering of the _{iN}N candidates from most preferred to least preferred for the ith group. The end-of-file is marked by a test case with G = N = 0 and should not be processed.Output For each input case, the program should print the winner of the election on a single line. Sample Input 3 4 10 1 4 2 3 15 3 2 1 4 12 4 3 2 1 3 2 10 1 2 10 1 2 20 2 1 0 0 Sample Output 4 1 Source |

[Submit] [Go Back] [Status] [Discuss]

All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di

Any problem, Please Contact Administrator