結果
問題 |
No.1708 Quality of Contest
|
ユーザー |
👑 |
提出日時 | 2022-01-18 02:36:28 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 433 ms / 2,000 ms |
コード長 | 424 bytes |
コンパイル時間 | 280 ms |
コンパイル使用メモリ | 82,048 KB |
実行使用メモリ | 148,736 KB |
最終ジャッジ日時 | 2024-11-23 13:10:57 |
合計ジャッジ時間 | 10,310 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 23 |
ソースコード
n, m, x = map(int, input().split()) P = [[] for _ in range(m)] for _ in range(n): a, b = map(int, input().split()) b -= 1 P[b].append(a) lst = [] for p in P: if not p: continue p.sort(reverse = True) p[0] += x lst += p lst.sort(reverse = True) cum = [0] for l in lst: cum.append(cum[-1] + l) k = int(input()) C = list(map(int, input().split())) print(sum(cum[c] for c in C))