結果
| 問題 | No.3656 Game Scores and Costs |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-08-30 16:09:12 |
| 言語 | PyPy3 (7.3.23) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 478 bytes |
| 記録 | |
| コンパイル時間 | 242 ms |
| コンパイル使用メモリ | 96,232 KB |
| 実行使用メモリ | 116,352 KB |
| 最終ジャッジ日時 | 2026-08-30 16:09:17 |
| 合計ジャッジ時間 | 4,639 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | TLE * 1 -- * 20 |
ソースコード
n, k, x = map(int, input().split()) a = list(map(int, input().split())) score = -x counter = [] for i in range(1, n+1): count = min(k, i) ba = a[:i] ba.sort(reverse = True) counter.append(sum(ba[:count])) for i in range(1, n+1): """ scoref = [] ba = a[:i] ba.sort(reverse = True) for j in range(min(k, i)): scoref.append(ba[j]) curr_score = sum(scoref) - x*i """ curr_score = counter[i-1] - x*i score = max(curr_score, score) print(score)