結果
問題 | No.617 Nafmo、買い出しに行く |
ユーザー |
![]() |
提出日時 | 2020-05-03 18:38:52 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 672 ms / 2,000 ms |
コード長 | 356 bytes |
コンパイル時間 | 262 ms |
コンパイル使用メモリ | 82,400 KB |
実行使用メモリ | 221,168 KB |
最終ジャッジ日時 | 2024-06-22 04:04:19 |
合計ジャッジ時間 | 8,352 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 20 |
ソースコード
N, K = map(int, input().split())items = []Try = []for shop in range(N):items.append(int(input()))for way in range(2 ** N):bug = []for item in range(N):if ((way >> item) & 1) == 1:bug.append(items[item])Try.append(sum(bug))bug.clear()movable_items = [i for i in Try if i <= K]print(max(movable_items))