結果
| 問題 |
No.1708 Quality of Contest
|
| コンテスト | |
| ユーザー |
lllllll88938494
|
| 提出日時 | 2022-06-04 05:49:26 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 1,028 ms / 2,000 ms |
| コード長 | 424 bytes |
| コンパイル時間 | 139 ms |
| コンパイル使用メモリ | 82,244 KB |
| 実行使用メモリ | 142,604 KB |
| 最終ジャッジ日時 | 2024-09-21 03:35:23 |
| 合計ジャッジ時間 | 19,567 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 23 |
ソースコード
n,m,x=map(int,input().split())
ns=[list(map(int,input().split())) for i in range(n)]
k=int(input())
c=list(map(int,input().split()))
ns.sort(reverse=True)
now=-1
s=set()
for i in range(n):
if ns[i][1] not in s:
ns[i][0]+=x
s.add(ns[i][1])
ns.sort(reverse=True)
for i in range(n-1):
ns[i+1][0]+=ns[i][0]
ans=0
for i in range(k):
if c[i] == 0: continue
ans+= ns[c[i]-1][0]
print(ans)
lllllll88938494