結果

問題 No.3046 yukicoderの過去問
ユーザー zutsuzutsu
提出日時 2022-05-10 22:47:45
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 276 bytes
コンパイル時間 304 ms
コンパイル使用メモリ 87,208 KB
実行使用メモリ 95,552 KB
最終ジャッジ日時 2023-09-25 06:52:05
合計ジャッジ時間 4,493 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
75,736 KB
testcase_01 AC 74 ms
71,392 KB
testcase_02 AC 76 ms
71,356 KB
testcase_03 AC 92 ms
77,140 KB
testcase_04 AC 75 ms
71,228 KB
testcase_05 AC 82 ms
76,772 KB
testcase_06 TLE -
testcase_07 -- -
testcase_08 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

K = int(input())
N = int(input())
X = list(map(int, input().split()))
dp = [0]*K
mod = 10**9 + 7
for x in X:
    if x < K:
        dp[x-1] = 1

for j in range(K):
    for x in X:
        if 0 <= j-x < K:
            dp[j] += dp[j-x]
            dp[j] %= mod

print(dp[-1]%mod)
0