結果

問題 No.1708 Quality of Contest
ユーザー irumo8202irumo8202
提出日時 2022-02-02 14:37:29
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,147 ms / 2,000 ms
コード長 474 bytes
コンパイル時間 417 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 145,280 KB
最終ジャッジ日時 2024-06-11 09:24:38
合計ジャッジ時間 19,007 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
52,224 KB
testcase_01 AC 40 ms
51,840 KB
testcase_02 AC 36 ms
51,840 KB
testcase_03 AC 92 ms
76,672 KB
testcase_04 AC 95 ms
76,928 KB
testcase_05 AC 93 ms
76,800 KB
testcase_06 AC 87 ms
75,136 KB
testcase_07 AC 91 ms
76,800 KB
testcase_08 AC 40 ms
51,712 KB
testcase_09 AC 919 ms
144,768 KB
testcase_10 AC 830 ms
145,024 KB
testcase_11 AC 965 ms
136,576 KB
testcase_12 AC 962 ms
136,704 KB
testcase_13 AC 881 ms
143,744 KB
testcase_14 AC 950 ms
137,088 KB
testcase_15 AC 841 ms
144,512 KB
testcase_16 AC 944 ms
145,280 KB
testcase_17 AC 1,147 ms
145,152 KB
testcase_18 AC 930 ms
144,896 KB
testcase_19 AC 970 ms
145,152 KB
testcase_20 AC 886 ms
145,152 KB
testcase_21 AC 984 ms
129,472 KB
testcase_22 AC 961 ms
129,280 KB
testcase_23 AC 962 ms
130,012 KB
testcase_24 AC 808 ms
143,104 KB
testcase_25 AC 782 ms
143,104 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M, X = map(int, input().split())
problems = [list(map(int, input().split())) for _ in range(N)]
problems.sort(reverse=True)
used = [False] * (M + 1)
for i in range(N):
    if used[problems[i][1]]:
        continue
    problems[i][0] += X
    used[problems[i][1]] = True
problems.sort(reverse=True)

score = [0]
for p in problems:
    score.append(score[-1] + p[0])

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

ans = 0
for c in C:
    ans += score[c]

print(ans)
0