結果

問題 No.447 ゆきこーだーの雨と雪 (2)
ユーザー ichibanshiboriichibanshibori
提出日時 2016-11-19 00:41:28
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 77 ms / 2,000 ms
コード長 1,206 bytes
コンパイル時間 197 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 13,056 KB
最終ジャッジ日時 2024-05-04 20:10:58
合計ジャッジ時間 2,777 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
11,008 KB
testcase_01 AC 31 ms
10,880 KB
testcase_02 AC 32 ms
10,880 KB
testcase_03 AC 44 ms
11,136 KB
testcase_04 AC 42 ms
11,008 KB
testcase_05 AC 63 ms
12,416 KB
testcase_06 AC 69 ms
12,928 KB
testcase_07 AC 57 ms
11,520 KB
testcase_08 AC 55 ms
12,032 KB
testcase_09 AC 70 ms
12,800 KB
testcase_10 AC 39 ms
11,136 KB
testcase_11 AC 47 ms
11,008 KB
testcase_12 AC 47 ms
11,520 KB
testcase_13 AC 64 ms
12,416 KB
testcase_14 AC 73 ms
12,672 KB
testcase_15 AC 47 ms
11,264 KB
testcase_16 AC 40 ms
11,264 KB
testcase_17 AC 46 ms
11,136 KB
testcase_18 AC 37 ms
11,136 KB
testcase_19 AC 77 ms
12,928 KB
testcase_20 AC 74 ms
13,056 KB
testcase_21 AC 46 ms
11,264 KB
testcase_22 AC 45 ms
11,264 KB
testcase_23 AC 53 ms
11,392 KB
testcase_24 AC 68 ms
12,288 KB
testcase_25 AC 76 ms
12,672 KB
testcase_26 AC 57 ms
11,520 KB
testcase_27 AC 56 ms
11,392 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