結果

問題 No.617 Nafmo、買い出しに行く
ユーザー turner18_jpturner18_jp
提出日時 2018-04-30 11:33:29
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 228 bytes
コンパイル時間 1,041 ms
コンパイル使用メモリ 10,788 KB
実行使用メモリ 7,884 KB
最終ジャッジ日時 2023-09-10 08:21:21
合計ジャッジ時間 3,791 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 16 ms
7,724 KB
testcase_03 WA -
testcase_04 AC 15 ms
7,872 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 259 ms
7,784 KB
testcase_08 AC 15 ms
7,764 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 267 ms
7,836 KB
testcase_13 AC 228 ms
7,804 KB
testcase_14 AC 261 ms
7,800 KB
testcase_15 AC 15 ms
7,728 KB
testcase_16 AC 15 ms
7,836 KB
testcase_17 AC 16 ms
7,780 KB
testcase_18 AC 15 ms
7,784 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 15 ms
7,856 KB
権限があれば一括ダウンロードができます

ソースコード

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