結果
| 問題 | No.1708 Quality of Contest |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-05-14 22:58:23 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 774 ms / 2,000 ms |
| コード長 | 346 bytes |
| 記録 | |
| コンパイル時間 | 150 ms |
| コンパイル使用メモリ | 85,120 KB |
| 実行使用メモリ | 151,784 KB |
| 最終ジャッジ日時 | 2026-05-14 22:58:41 |
| 合計ジャッジ時間 | 14,657 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 23 |
ソースコード
n,m,x=map(int,input().split())
c=[list(map(int,input().split())) for i in range(n)]
c.sort(reverse=True);s=set()
for i in range(n):
if c[i][1] not in s:
s.add(c[i][1])
c[i][0]+=x
c.sort(reverse=True)
t=[0]
for i,j in c:
t.append(t[-1]+i)
ans=0;int(input())
for i in list(map(int,input().split())):
ans+=t[i]
print(ans)