結果

問題 No.617 Nafmo、買い出しに行く
ユーザー turner18_jp
提出日時 2018-04-30 11:33:29
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 228 bytes
コンパイル時間 162 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-06-27 23:49:31
合計ジャッジ時間 3,553 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1
other AC * 11 WA * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int, input().split())
l = [int(input()) for i in range(n)]
ans = 0
def f(i, now):
  global ans
  if i >= len(l) or now > k:
    return
  if now > ans:
    ans = now
  f(i+1, now+l[i])
  f(i+1, now)

f(0, 0)
print(ans)
0