結果
| 問題 |
No.1708 Quality of Contest
|
| コンテスト | |
| ユーザー |
Eki1009
|
| 提出日時 | 2021-10-15 21:41:15 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 363 ms / 2,000 ms |
| コード長 | 428 bytes |
| コンパイル時間 | 132 ms |
| コンパイル使用メモリ | 81,996 KB |
| 実行使用メモリ | 134,224 KB |
| 最終ジャッジ日時 | 2024-09-17 17:20:25 |
| 合計ジャッジ時間 | 7,273 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 23 |
ソースコード
n,m,x = map(int,input().split())
L = [[] for _ in range(m+1)]
for _ in range(n):
a,b = map(int,input().split())
L[b].append(a)
Z = []
for l in L:
if not l:
continue
l.sort()
l[-1] += x
for z in l:
Z.append(z)
Z.sort(reverse=True)
D = [0]*(n+1)
for i,z in enumerate(Z):
D[i+1] = D[i]+z
k = int(input())
C = tuple(map(int,input().split()))
ans = 0
for c in C:
ans += D[c]
print(ans)
Eki1009