結果

問題 No.617 Nafmo、買い出しに行く
ユーザー senden_litesenden_lite
提出日時 2017-12-27 12:39:25
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 420 bytes
コンパイル時間 142 ms
コンパイル使用メモリ 10,796 KB
実行使用メモリ 30,188 KB
最終ジャッジ日時 2023-08-23 07:10:05
合計ジャッジ時間 7,299 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 463 ms
13,280 KB
testcase_01 AC 20 ms
8,172 KB
testcase_02 AC 663 ms
13,540 KB
testcase_03 AC 1,791 ms
18,528 KB
testcase_04 AC 141 ms
9,900 KB
testcase_05 TLE -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

i = input().split()
N = int(i[0])
K = int(i[1])

a =[0]*N

for i in range(N):
    a[i] = int(input())

b = [True] + [False]*K
l = len(b)

for i in range(N):
    n = a[i]
    for j in range(l):
        if b[-(j+1)] != False:
            index = l-j-1
            if n + index <= K and b[n+index] == False:
                b[n+index] = True

for i in range(l):
    if b[-(i+1)] != False:
        print(l-i-1)
        break
0