結果

問題 No.3046 yukicoderの過去問
ユーザー satama6satama6
提出日時 2022-04-25 16:11:42
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 267 bytes
コンパイル時間 281 ms
コンパイル使用メモリ 87,092 KB
実行使用メモリ 95,212 KB
最終ジャッジ日時 2023-09-09 18:38:26
合計ジャッジ時間 4,635 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,044 KB
testcase_01 AC 68 ms
71,220 KB
testcase_02 AC 68 ms
71,280 KB
testcase_03 AC 81 ms
77,012 KB
testcase_04 AC 68 ms
71,136 KB
testcase_05 AC 76 ms
76,720 KB
testcase_06 TLE -
testcase_07 -- -
testcase_08 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

K = int(input())
N = int(input())
X = list(map(int, input().split()))

dp = [0 for _ in range(K+1)]
dp[0] = 1
mod = 1000000007

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

print(dp[K])
0