結果

問題 No.1708 Quality of Contest
コンテスト
ユーザー irumo8202
提出日時 2022-02-02 14:37:29
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 823 ms / 2,000 ms
コード長 474 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 130 ms
コンパイル使用メモリ 85,608 KB
実行使用メモリ 150,620 KB
最終ジャッジ日時 2026-03-04 11:26:56
合計ジャッジ時間 15,101 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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