結果
問題 |
No.8046 yukicoderの過去問
|
ユーザー |
|
提出日時 | 2022-05-10 22:47:45 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 276 bytes |
コンパイル時間 | 129 ms |
コンパイル使用メモリ | 82,268 KB |
実行使用メモリ | 92,076 KB |
最終ジャッジ日時 | 2024-07-18 05:43:59 |
合計ジャッジ時間 | 3,826 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 6 TLE * 1 -- * 2 |
ソースコード
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)