結果

問題 No.1708 Quality of Contest
ユーザー mahiro72mahiro72
提出日時 2021-10-15 22:37:11
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,224 ms / 2,000 ms
コード長 408 bytes
コンパイル時間 93 ms
コンパイル使用メモリ 11,920 KB
実行使用メモリ 95,016 KB
最終ジャッジ日時 2023-10-17 20:34:02
合計ジャッジ時間 20,421 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,164 KB
testcase_01 AC 31 ms
10,164 KB
testcase_02 AC 32 ms
10,164 KB
testcase_03 AC 46 ms
11,548 KB
testcase_04 AC 49 ms
11,476 KB
testcase_05 AC 45 ms
11,296 KB
testcase_06 AC 43 ms
11,256 KB
testcase_07 AC 43 ms
11,264 KB
testcase_08 AC 29 ms
10,164 KB
testcase_09 AC 1,128 ms
95,016 KB
testcase_10 AC 1,007 ms
82,872 KB
testcase_11 AC 1,044 ms
64,072 KB
testcase_12 AC 1,086 ms
67,092 KB
testcase_13 AC 1,002 ms
59,700 KB
testcase_14 AC 1,098 ms
72,172 KB
testcase_15 AC 1,224 ms
88,416 KB
testcase_16 AC 1,212 ms
88,944 KB
testcase_17 AC 1,087 ms
73,756 KB
testcase_18 AC 1,093 ms
74,548 KB
testcase_19 AC 1,129 ms
77,716 KB
testcase_20 AC 1,112 ms
74,020 KB
testcase_21 AC 1,141 ms
75,604 KB
testcase_22 AC 1,100 ms
72,436 KB
testcase_23 AC 1,219 ms
89,208 KB
testcase_24 AC 856 ms
54,580 KB
testcase_25 AC 854 ms
54,520 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M,X = map(int,input().split())
d = {x:[] for x in range(1,M+1)}


for i in range(N):
    A,B = map(int,input().split())
    d[B].append(A)

l = []
for k,v in d.items():
    tmp = sorted(v)
    if tmp:tmp[-1]+=X
    l+=tmp

l.sort(reverse=True)
com = [0]
for i in range(len(l)):
    com.append(com[i]+l[i])

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

ans = 0
for i in C:
    ans+=com[i]
print(ans)
0