結果

問題 No.447 ゆきこーだーの雨と雪 (2)
ユーザー ichibanshiboriichibanshibori
提出日時 2016-11-19 00:41:28
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 55 ms / 2,000 ms
コード長 1,206 bytes
コンパイル時間 78 ms
コンパイル使用メモリ 11,000 KB
実行使用メモリ 10,800 KB
最終ジャッジ日時 2023-08-17 13:32:17
合計ジャッジ時間 2,219 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
8,480 KB
testcase_01 AC 15 ms
8,320 KB
testcase_02 AC 15 ms
8,376 KB
testcase_03 AC 28 ms
8,576 KB
testcase_04 AC 26 ms
8,028 KB
testcase_05 AC 43 ms
10,068 KB
testcase_06 AC 47 ms
10,448 KB
testcase_07 AC 36 ms
9,140 KB
testcase_08 AC 35 ms
9,548 KB
testcase_09 AC 50 ms
10,624 KB
testcase_10 AC 22 ms
8,092 KB
testcase_11 AC 29 ms
8,732 KB
testcase_12 AC 30 ms
8,960 KB
testcase_13 AC 44 ms
10,128 KB
testcase_14 AC 50 ms
10,396 KB
testcase_15 AC 29 ms
8,640 KB
testcase_16 AC 22 ms
8,728 KB
testcase_17 AC 29 ms
8,628 KB
testcase_18 AC 20 ms
8,476 KB
testcase_19 AC 54 ms
10,552 KB
testcase_20 AC 53 ms
10,800 KB
testcase_21 AC 27 ms
8,536 KB
testcase_22 AC 28 ms
8,688 KB
testcase_23 AC 35 ms
8,904 KB
testcase_24 AC 49 ms
9,684 KB
testcase_25 AC 55 ms
10,300 KB
testcase_26 AC 39 ms
9,096 KB
testcase_27 AC 37 ms
9,008 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import floor

def calc_score(A, B):
    return 50 * A + floor(500 * A / (8 + 2 * B))

def read_T():
    s_name, s_q_no = tuple(input().split())
    i_q_no = int(ord(s_q_no) - ord('A'))
    return s_name, i_q_no

N = int(input())
L = [int(s_l) for s_l in input().split()]
T = int(input())

q_no_rank = {}
player_rank = {}
player_score = {}

for i in range(T):
    s_name, i_q_no = read_T()

    if (i_q_no not in q_no_rank):
        rank = 1
    else:
        rank = q_no_rank[i_q_no]

    q_no_rank[i_q_no] = rank + 1

    score = calc_score(L[i_q_no], rank)

    if s_name not in player_score:
        score_lst = [0 for _ in range(N)]
    else:
        score_lst = player_score[s_name]

    score_lst[i_q_no] = score
    player_score[s_name] = score_lst


    if s_name not in player_rank:
        total_score = 0
    else:
        total_score, _ = player_rank[s_name]

    player_rank[s_name] = (total_score + score, i)

ans_lst = []
for k, v in player_rank.items():
    ans_lst.append((k, v[0], v[1], player_score[k]))

i_rank = 1
for row in sorted(ans_lst, key=lambda x:(-x[1], x[2])):
    print('{} {} {} {}'.format(i_rank, row[0], ' '.join(str(i) for i in row[3]), row[1]))
    i_rank += 1
0