当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

3224:Go for Lab Cup!

题目描述

The Lab Cup Table Tennis Competition is going to take place soon among laboratories in PKU. Students from the AI Lab are all extreme enthusiasts in table tennis and hold strong will to represent the lab in the competition. Limited by the quota, however, only one of them can be selected to play in the competition.

To make the selection fair, they agreed on a single round robin tournament, in which every pair of students played a match decided by best of 5 games. The one winning the most matches would become representative of the lab. Now Ava, head of the lab, has in hand a form containing the scores of all matches. Who should she decide on for the competition?

输入解释

The input contains exactly one test case. The test case starts with a line containing n (2 ≤ n ≤ 100), the number of students in the lab. Then follows an n × n matrix A. Each element in the matrix will be one of 0, 1, 2 and 3. The element at row i and column j, aij, is the number of games won by the ith student in his/her match with the jth student. Exactly one of aij and aji (ij) is 3 and the other one will be less than 3. All diagonal elements of the matrix are 0’s.

输出解释

Output the number of the student who won the most matches. In the case of a tie, choose the one numbered the smallest.

输入样例
4
0 0 3 2
3 0 3 1
2 2 0 2
3 3 3 0
输出样例
4

该题目是Virtual Judge题目,来自 北京大学POJ

源链接: POJ-3224

最后修改于 2020-10-29T06:56:13+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
1000 131072