結果
| 問題 | No.3656 Game Scores and Costs |
| コンテスト | |
| ユーザー |
detteiuu
|
| 提出日時 | 2026-08-30 13:34:41 |
| 言語 | PyPy3 (7.3.23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 286 bytes |
| 記録 | |
| コンパイル時間 | 262 ms |
| コンパイル使用メモリ | 95,980 KB |
| 実行使用メモリ | 116,992 KB |
| 最終ジャッジ日時 | 2026-08-30 13:35:29 |
| 合計ジャッジ時間 | 6,033 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 7 WA * 14 |
ソースコード
from heapq import heappush, heappop
N, K, X = map(int, input().split())
A = list(map(int, input().split()))
SUM = 0
que = []
ans = -(1<<60)
for a in A:
SUM += a
heappush(que, a)
while K < len(que):
SUM -= heappop(que)
ans = max(ans, SUM-X*len(que))
print(ans)
detteiuu