結果
問題 | No.617 Nafmo、買い出しに行く |
ユーザー |
|
提出日時 | 2023-06-21 00:52:52 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 249 bytes |
コンパイル時間 | 735 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 16,256 KB |
最終ジャッジ日時 | 2024-06-28 11:39:19 |
合計ジャッジ時間 | 4,990 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 2 |
other | AC * 6 TLE * 1 -- * 13 |
ソースコード
N,K=map(int,input().split())A=[]for i in range(N):a=int(input())A.append(a)ans=0for bit in range(2**N):ret=0for i in range(N):if bit>>i&1:ret+=A[i]if ret<=K:ans=max(ans,ret)print(ans)