結果

問題 No.504 ゲーム大会(ランキング)
ユーザー iad_2889iad_2889
提出日時 2019-05-18 07:01:47
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 418 bytes
コンパイル時間 235 ms
コンパイル使用メモリ 11,996 KB
実行使用メモリ 31,556 KB
最終ジャッジ日時 2023-10-17 07:31:04
合計ジャッジ時間 4,244 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
14,544 KB
testcase_01 AC 29 ms
10,092 KB
testcase_02 AC 29 ms
10,092 KB
testcase_03 AC 28 ms
10,092 KB
testcase_04 AC 29 ms
10,092 KB
testcase_05 AC 29 ms
10,092 KB
testcase_06 AC 28 ms
10,092 KB
testcase_07 TLE -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

def next_player(num):
    current = 0
    while True:
        yield current
        current+=1
        current%=num

N = int(input())
np = next_player(N)
players = {i:0 for i in range(N)}
plays = map(int,[input() for x in range(N)])
for play in plays:
    current = next(np)
    players[current]+=play
    ks_score = players[0]
    rank = sorted(list(players.values()),reverse=True).index(ks_score) + 1
    print(rank)
0