結果

問題 No.1708 Quality of Contest
ユーザー chineristACchineristAC
提出日時 2020-09-12 22:16:58
言語 PyPy3
(7.3.15)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 507 bytes
コンパイル時間 185 ms
コンパイル使用メモリ 81,788 KB
実行使用メモリ 128,920 KB
最終ジャッジ日時 2023-10-17 19:38:35
合計ジャッジ時間 17,702 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 36 ms
53,368 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 36 ms
53,368 KB
testcase_09 AC 1,012 ms
128,516 KB
testcase_10 AC 894 ms
128,612 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 921 ms
128,584 KB
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 -
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M,X = map(int,input().split())
problem = []
for _ in range(N):
    v,g = map(int,input().split())
    problem.append([v,g-1])

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

problem.sort(reverse=True)

used = [False]*M

for i in range(N):
    v,g = problem[i]
    if not used[g]:
        used[g] = True
        problem[i] = v + X
    else:
        problem[i] = v

problem = [0] + problem
for i in range(1,N+1):
    problem[i] += problem[i-1]

ans = 0
for AC in p:
    ans += problem[AC]

print(ans)
0