結果

問題 No.3046 yukicoderの過去問
ユーザー titiatitia
提出日時 2019-04-01 21:58:28
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 302 bytes
コンパイル時間 330 ms
コンパイル使用メモリ 87,052 KB
実行使用メモリ 95,336 KB
最終ジャッジ日時 2023-08-17 21:58:16
合計ジャッジ時間 4,492 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,244 KB
testcase_01 AC 72 ms
71,124 KB
testcase_02 AC 72 ms
71,336 KB
testcase_03 AC 88 ms
77,176 KB
testcase_04 AC 72 ms
71,316 KB
testcase_05 AC 78 ms
77,172 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