結果
問題 |
No.617 Nafmo、買い出しに行く
|
ユーザー |
![]() |
提出日時 | 2025-03-20 18:39:23 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 462 ms / 2,000 ms |
コード長 | 279 bytes |
コンパイル時間 | 216 ms |
コンパイル使用メモリ | 82,460 KB |
実行使用メモリ | 76,060 KB |
最終ジャッジ日時 | 2025-03-20 18:39:29 |
合計ジャッジ時間 | 5,686 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 20 |
ソースコード
n, k = map(int, input().split()) a = [int(input()) for _ in range(n)] max_sum = 0 for mask in range(1 << n): total = 0 for j in range(n): if mask & (1 << j): total += a[j] if total <= k and total > max_sum: max_sum = total print(max_sum)