結果
問題 |
No.2329 Nafmo、イカサマをする
|
ユーザー |
![]() |
提出日時 | 2025-06-12 18:20:03 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 566 bytes |
コンパイル時間 | 195 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 52,480 KB |
最終ジャッジ日時 | 2025-06-12 18:20:27 |
合計ジャッジ時間 | 3,170 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 14 WA * 26 |
ソースコード
n, m, k = map(int, input().split()) a = list(map(int, input().split())) if n > 0 else [] a.sort(reverse=True) max_sum = 0 for t in range(0, k + 1): current_sum = 0 rem = t for num in a: if rem == 0: break if num == 0: current_sum += 0 * rem rem = 0 break max_possible = (m - current_sum) // num cnt = min(rem, max_possible) current_sum += cnt * num rem -= cnt if current_sum <= m and current_sum > max_sum: max_sum = current_sum print(max_sum)