結果
| 問題 |
No.8046 yukicoderの過去問
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-05-10 22:46:44 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 276 bytes |
| コンパイル時間 | 74 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 17,696 KB |
| 最終ジャッジ日時 | 2024-07-18 05:42:57 |
| 合計ジャッジ時間 | 3,965 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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)