結果

問題 No.447 ゆきこーだーの雨と雪 (2)
ユーザー nebukuro09nebukuro09
提出日時 2016-11-18 22:39:30
言語 Python2
(2.7.18)
結果
AC  
実行時間 141 ms / 2,000 ms
コード長 551 bytes
コンパイル時間 573 ms
コンパイル使用メモリ 7,092 KB
実行使用メモリ 9,336 KB
最終ジャッジ日時 2023-08-17 11:08:26
合計ジャッジ時間 4,537 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 22 ms
7,836 KB
testcase_01 AC 20 ms
7,660 KB
testcase_02 AC 20 ms
7,644 KB
testcase_03 AC 81 ms
7,676 KB
testcase_04 AC 74 ms
7,892 KB
testcase_05 AC 110 ms
8,712 KB
testcase_06 AC 112 ms
9,048 KB
testcase_07 AC 115 ms
8,176 KB
testcase_08 AC 85 ms
8,552 KB
testcase_09 AC 125 ms
9,224 KB
testcase_10 AC 50 ms
7,736 KB
testcase_11 AC 92 ms
7,736 KB
testcase_12 AC 67 ms
8,072 KB
testcase_13 AC 112 ms
8,908 KB
testcase_14 AC 134 ms
9,284 KB
testcase_15 AC 92 ms
7,792 KB
testcase_16 AC 41 ms
7,912 KB
testcase_17 AC 93 ms
7,820 KB
testcase_18 AC 43 ms
7,792 KB
testcase_19 AC 126 ms
9,336 KB
testcase_20 AC 134 ms
9,284 KB
testcase_21 AC 71 ms
7,920 KB
testcase_22 AC 84 ms
8,020 KB
testcase_23 AC 117 ms
7,988 KB
testcase_24 AC 131 ms
8,696 KB
testcase_25 AC 141 ms
9,324 KB
testcase_26 AC 121 ms
8,228 KB
testcase_27 AC 120 ms
8,116 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from fractions import Fraction as F
score = lambda A, B: 50*A+int(F(50*A, F(4,5)+F(1,5)*B))

N = input()
L = map(int, raw_input().split())
ACed = [0 for _ in xrange(N)]
T = input()
d = {}

for i in xrange(T):
    n, p = raw_input().split()
    p = ord(p) - ord('A')
    if n not in d:
        d[n] = [0 for _ in xrange(N+1)]
    ACed[p] += 1
    d[n][p] = score(L[p], ACed[p])
    d[n][N] = i

ans = sorted(d.keys(), key=lambda x:(-sum(d[x][:-1]), d[x][-1]))
for i, k in enumerate(ans):
    print i+1, k, ' '.join(map(str, d[k][:-1])), sum(d[k][:-1])
0