結果

問題 No.1708 Quality of Contest
ユーザー irumo8202irumo8202
提出日時 2022-02-02 14:37:29
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,065 ms / 2,000 ms
コード長 474 bytes
コンパイル時間 828 ms
コンパイル使用メモリ 87,072 KB
実行使用メモリ 146,604 KB
最終ジャッジ日時 2023-09-02 02:46:59
合計ジャッジ時間 21,633 ms
ジャッジサーバーID
(参考情報)
judge16 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 65 ms
71,324 KB
testcase_01 AC 62 ms
71,220 KB
testcase_02 AC 70 ms
71,132 KB
testcase_03 AC 113 ms
78,056 KB
testcase_04 AC 102 ms
78,004 KB
testcase_05 AC 102 ms
78,088 KB
testcase_06 AC 103 ms
77,864 KB
testcase_07 AC 106 ms
77,756 KB
testcase_08 AC 67 ms
71,452 KB
testcase_09 AC 989 ms
146,124 KB
testcase_10 AC 867 ms
146,268 KB
testcase_11 AC 984 ms
137,308 KB
testcase_12 AC 982 ms
137,680 KB
testcase_13 AC 935 ms
145,032 KB
testcase_14 AC 1,001 ms
135,240 KB
testcase_15 AC 877 ms
138,272 KB
testcase_16 AC 987 ms
139,268 KB
testcase_17 AC 965 ms
146,184 KB
testcase_18 AC 933 ms
146,200 KB
testcase_19 AC 1,065 ms
146,504 KB
testcase_20 AC 921 ms
146,604 KB
testcase_21 AC 1,017 ms
131,076 KB
testcase_22 AC 986 ms
128,748 KB
testcase_23 AC 994 ms
131,844 KB
testcase_24 AC 831 ms
144,192 KB
testcase_25 AC 872 ms
144,468 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