結果

問題 No.1708 Quality of Contest
ユーザー titiatitia
提出日時 2021-10-16 01:45:50
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 449 bytes
コンパイル時間 212 ms
コンパイル使用メモリ 11,892 KB
実行使用メモリ 84,728 KB
最終ジャッジ日時 2023-10-17 21:59:12
合計ジャッジ時間 15,154 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
9,948 KB
testcase_01 AC 29 ms
9,948 KB
testcase_02 AC 29 ms
10,012 KB
testcase_03 RE -
testcase_04 AC 40 ms
11,452 KB
testcase_05 AC 40 ms
11,300 KB
testcase_06 RE -
testcase_07 RE -
testcase_08 AC 29 ms
9,948 KB
testcase_09 AC 730 ms
84,728 KB
testcase_10 AC 681 ms
72,664 KB
testcase_11 AC 787 ms
76,264 KB
testcase_12 AC 789 ms
76,072 KB
testcase_13 AC 755 ms
75,452 KB
testcase_14 AC 811 ms
77,856 KB
testcase_15 AC 837 ms
78,988 KB
testcase_16 AC 837 ms
79,976 KB
testcase_17 AC 787 ms
76,692 KB
testcase_18 AC 794 ms
78,292 KB
testcase_19 AC 806 ms
79,088 KB
testcase_20 AC 769 ms
77,868 KB
testcase_21 AC 816 ms
78,652 KB
testcase_22 AC 803 ms
76,596 KB
testcase_23 AC 819 ms
79,980 KB
testcase_24 AC 683 ms
72,564 KB
testcase_25 AC 688 ms
72,592 KB
権限があれば一括ダウンロードができます

ソースコード

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(N+1)]

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

XX=[]

for i in range(N+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