結果
問題 | No.3046 yukicoderの過去問 |
ユーザー | zutsu |
提出日時 | 2022-05-10 22:46:44 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 276 bytes |
コンパイル時間 | 78 ms |
コンパイル使用メモリ | 10,688 KB |
実行使用メモリ | 24,016 KB |
最終ジャッジ日時 | 2023-09-25 06:50:23 |
合計ジャッジ時間 | 4,154 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 16 ms
12,216 KB |
testcase_01 | AC | 17 ms
7,796 KB |
testcase_02 | AC | 16 ms
7,808 KB |
testcase_03 | AC | 214 ms
11,940 KB |
testcase_04 | AC | 15 ms
7,860 KB |
testcase_05 | AC | 77 ms
8,772 KB |
testcase_06 | TLE | - |
testcase_07 | -- | - |
testcase_08 | -- | - |
ソースコード
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)