結果

問題 No.1708 Quality of Contest
ユーザー yudai1102jpyudai1102jp
提出日時 2021-10-15 22:42:07
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 605 bytes
コンパイル時間 841 ms
コンパイル使用メモリ 11,920 KB
実行使用メモリ 99,760 KB
最終ジャッジ日時 2023-10-17 20:38:38
合計ジャッジ時間 4,881 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
10,092 KB
testcase_01 AC 30 ms
10,092 KB
testcase_02 AC 29 ms
10,092 KB
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 AC 28 ms
10,092 KB
testcase_09 TLE -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M, X = map(int, input().split())
AB = [[int(i) for i in input().split()] for j in range(N)]

K = int(input())
C = list(map(int, input().split()))


problem = {i+1: [] for i in range(M)}
for i in range(N):
    problem[AB[i][1]].append(AB[i][0])
for i in range(M):
    problem[i+1].sort(reverse=True)
    problem[i+1][0] += X
AB.sort(reverse=True, key=lambda x: x[0])

ans_pro = []
for i in range(M):
    ans_pro = ans_pro + problem[i+1]
ans_pro.sort(reverse=True)
for i in range(1, N):
    ans_pro[i] += ans_pro[i-1]
ans = 0
for i in range(K):
    if C[i] > 0:
        ans += ans_pro[C[i]-1]
print(ans)
0