結果

問題 No.3046 yukicoderの過去問
ユーザー OhnoHirokiOhnoHiroki
提出日時 2024-02-29 01:12:29
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 230 bytes
コンパイル時間 313 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 89,460 KB
最終ジャッジ日時 2024-02-29 01:12:34
合計ジャッジ時間 5,129 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
60,136 KB
testcase_01 AC 37 ms
53,332 KB
testcase_02 AC 41 ms
53,332 KB
testcase_03 AC 51 ms
62,644 KB
testcase_04 AC 37 ms
53,332 KB
testcase_05 AC 51 ms
62,500 KB
testcase_06 TLE -
testcase_07 -- -
testcase_08 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

DP = [0]*(K+1)
DP[0] = 1
for i in range(K):
    for xx in x:
        if i+xx <= K:
            DP[xx+i] = (DP[xx+i] + DP[i]) % (10**9+7)
print(DP[K]%(10**9+7))
0