g471. 12959: Strategy Game
標籤 :
通過比率 : 176人/196人 ( 90% ) [非即時]
評分方式:
Tolerant

最近更新 : 2023-08-18 12:40

內容

A strategy game with $J$ players is played around a table. Players are identified by numbers from 1 to $J$ and will play a total of $R$ rounds. At each round each player will play once, in the order of their identifiers; that is, player 1 will play first, player 2 will play second, and so on. Once player $J$ plays, the round is complete, and a next round starts. A player earns a certain amount of Victory Points every time she or he plays. After all rounds are finished the total points of each player is computed as the sum of Victory Points the player earned on each round. The winner is the player with the maximum number of points; in case of a tie the winner is the player who earned the maximum number of points and played last. Given the number of players, the number of rounds and a list describing the Victory Points in the order they were obtained, you must determine which player is the winner.

輸入說明

The input contains several test cases. In each test case, the first line contains two integers $J$ and $R$, respectively the number of players and the number of turns $(1 \leq J, R \leq 500)$. The second line contains $J \cdot R$ integers, representing the Victory Points earned by each player in each turn, in the order they happened. The Victory Points obtained in each turn will be always integer numbers between $0$ and $100$, inclusive. If both $J$ and $R$ are of values zero, then the input ends.

輸出說明

For each test case in the input, your program must produce one single line, containing the integer representing the winner.

範例輸入 #1
3 3
1 1 1 1 2 2 2 3 3
2 3
0 0 1 0 2 0
0 0
範例輸出 #1
3
1
測資資訊:
記憶體限制: 512 MB
不公開 測資點#0 (33%): 1.0s , <1M
不公開 測資點#1 (33%): 1.0s , <1M
不公開 測資點#2 (1%): 0.1s , <1K
不公開 測資點#3 (33%): 1.0s , <10M
提示 :

測資為隨機產生,若有錯誤歡迎提出

標籤:
出處:
UVA12959CPE第一題 [管理者: fire5386 (becaidorz) ]

本題狀況 本題討論 排行

編號 身分 題目 主題 人氣 發表日期
沒有發現任何「解題報告」