結果

問題 No.3046 yukicoderの過去問
ユーザー titiatitia
提出日時 2019-04-01 21:58:05
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 301 bytes
コンパイル時間 358 ms
コンパイル使用メモリ 10,628 KB
実行使用メモリ 12,220 KB
最終ジャッジ日時 2023-08-17 21:57:58
合計ジャッジ時間 4,169 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
12,220 KB
testcase_01 AC 15 ms
7,796 KB
testcase_02 AC 15 ms
7,948 KB
testcase_03 AC 260 ms
11,960 KB
testcase_04 AC 15 ms
7,888 KB
testcase_05 AC 113 ms
8,772 KB
testcase_06 TLE -
testcase_07 -- -
testcase_08 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

K=int(input())
N=int(input())
X=list(map(int,input().split()))
mod=10**9+7

#X.sort()

DP=[0]*(K+1)
DP[0]=1

for i in range(K):
    if DP[i]==0:
        continue

    for j in range(N):
        if X[j]+i<=K:
            DP[X[j]+i]=(DP[i]+DP[X[j]+i])%mod

        else:
            break

print(DP[-1])
0