結果

問題 No.1708 Quality of Contest
ユーザー titiatitia
提出日時 2021-10-16 01:47:07
言語 PyPy3
(7.3.15)
結果
MLE  
実行時間 -
コード長 457 bytes
コンパイル時間 187 ms
コンパイル使用メモリ 81,724 KB
実行使用メモリ 530,568 KB
最終ジャッジ日時 2023-10-17 22:00:15
合計ジャッジ時間 41,263 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,119 ms
468,844 KB
testcase_01 AC 1,111 ms
468,844 KB
testcase_02 AC 1,117 ms
468,844 KB
testcase_03 AC 1,352 ms
470,336 KB
testcase_04 AC 1,344 ms
470,460 KB
testcase_05 AC 1,293 ms
470,324 KB
testcase_06 AC 1,292 ms
470,168 KB
testcase_07 AC 1,295 ms
470,196 KB
testcase_08 AC 1,114 ms
468,844 KB
testcase_09 MLE -
testcase_10 MLE -
testcase_11 MLE -
testcase_12 MLE -
testcase_13 MLE -
testcase_14 MLE -
testcase_15 MLE -
testcase_16 MLE -
testcase_17 MLE -
testcase_18 MLE -
testcase_19 MLE -
testcase_20 MLE -
testcase_21 MLE -
testcase_22 MLE -
testcase_23 MLE -
testcase_24 MLE -
testcase_25 MLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N,M,p=map(int,input().split())
P=[tuple(map(int,input().split())) for i in range(N)]
K=int(input())
C=list(map(int,input().split()))

X=[[] for i in range(10**7+1)]

for a,b in P:
    X[b].append(a)

XX=[]

for i in range(10**7+1):
    X[i].sort()
    if len(X[i])>0:
        X[i][-1]+=p
        XX+=X[i]

XX.sort(reverse=True)

S=[0]
for xx in XX:
    S.append(S[-1]+xx)

ANS=0

for c in C:
    ANS+=S[c]

print(ANS)
0