結果
問題 | No.3046 yukicoderの過去問 |
ユーザー | zutsu |
提出日時 | 2022-05-21 18:38:57 |
言語 | Python3 (3.11.6 + numpy 1.26.0 + scipy 1.11.3) |
結果 |
TLE
|
実行時間 | - |
コード長 | 329 bytes |
コンパイル時間 | 139 ms |
コンパイル使用メモリ | 11,900 KB |
実行使用メモリ | 47,308 KB |
最終ジャッジ日時 | 2023-10-20 16:30:48 |
合計ジャッジ時間 | 7,053 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge13 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 408 ms
42,612 KB |
testcase_01 | AC | 411 ms
42,612 KB |
testcase_02 | AC | 409 ms
42,612 KB |
testcase_03 | TLE | - |
testcase_04 | -- | - |
testcase_05 | -- | - |
testcase_06 | -- | - |
testcase_07 | -- | - |
testcase_08 | -- | - |
ソースコード
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])