結果

問題 No.3046 yukicoderの過去問
ユーザー satama6satama6
提出日時 2022-04-25 16:02:11
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 275 bytes
コンパイル時間 91 ms
コンパイル使用メモリ 10,684 KB
実行使用メモリ 15,004 KB
最終ジャッジ日時 2023-09-09 18:36:20
合計ジャッジ時間 5,000 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
15,004 KB
testcase_01 AC 16 ms
7,832 KB
testcase_02 AC 15 ms
7,780 KB
testcase_03 AC 215 ms
11,852 KB
testcase_04 AC 15 ms
7,808 KB
testcase_05 AC 76 ms
9,068 KB
testcase_06 TLE -
testcase_07 -- -
testcase_08 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

K = int(input())
N = int(input())
X = list(map(int, input().split()))
X.sort()
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