結果
問題 |
No.8046 yukicoderの過去問
|
ユーザー |
|
提出日時 | 2022-05-21 18:38:57 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 329 bytes |
コンパイル時間 | 418 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 49,208 KB |
最終ジャッジ日時 | 2024-09-20 12:03:15 |
合計ジャッジ時間 | 6,050 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 3 TLE * 1 -- * 5 |
ソースコード
import numpy as np K = int(input()) N = int(input()) X = np.array(list(map(int, input().split()))) dp = np.zeros(K, dtype = int) Y = np.zeros(K, dtype = int) mod = 10**9 + 7 for x in X: if x < K: Y[-x] = 1 dp[x-1] = 1 for j in range(1,K): dp[j] += np.dot(Y[-j:], dp[:j]) dp[j] %= mod print(dp[-1])