結果

問題 No.3046 yukicoderの過去問
ユーザー mattu34mattu34
提出日時 2023-04-05 18:09:28
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 218 bytes
コンパイル時間 234 ms
コンパイル使用メモリ 82,588 KB
実行使用メモリ 91,740 KB
最終ジャッジ日時 2024-04-10 01:10:02
合計ジャッジ時間 4,245 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
59,360 KB
testcase_01 AC 41 ms
52,200 KB
testcase_02 AC 42 ms
52,688 KB
testcase_03 AC 52 ms
63,736 KB
testcase_04 AC 37 ms
52,212 KB
testcase_05 AC 45 ms
61,800 KB
testcase_06 TLE -
testcase_07 -- -
testcase_08 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD=10**9+7
K=int(input())
N=int(input())
dp=[0]*(K+1)
dp[0]=1
x=list(map(int,input().split()))
for i in range(K):
    for xx in x:
        if i+xx<=K:
            dp[i+xx]+=dp[i]
            dp[i+xx]%=MOD
print(dp[K])
0