結果
問題 | No.447 ゆきこーだーの雨と雪 (2) |
ユーザー | ichibanshibori |
提出日時 | 2016-11-18 23:25:36 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,209 bytes |
コンパイル時間 | 118 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 13,184 KB |
最終ジャッジ日時 | 2024-05-04 18:51:01 |
合計ジャッジ時間 | 2,216 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 30 ms
11,008 KB |
testcase_01 | AC | 27 ms
11,008 KB |
testcase_02 | AC | 27 ms
11,008 KB |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | WA | - |
testcase_24 | WA | - |
testcase_25 | WA | - |
testcase_26 | WA | - |
testcase_27 | WA | - |
ソースコード
from math import floor def calc_score(A, B): return 50 * A + floor(50 * A / (0.8 + 0.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