結果

問題 No.997 Jumping Kangaroo
ユーザー chinchilla
提出日時 2020-02-23 00:37:53
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
RE  
実行時間 -
コード長 389 bytes
コンパイル時間 272 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 44,484 KB
最終ジャッジ日時 2024-10-10 01:17:11
合計ジャッジ時間 19,185 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24 RE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np
md = 1000000007
n, w, k = map(int, input().split())
A = list(map(int, input().split()))
L = [1]+[0]*(w*2)
for i in range(1, w*2+1):
    L[i] = sum(L[i-a] for a in A)
g1 = L[w]
g2 = L[w*2] - g1**2
m = np.matrix([[g1, g2], [1, 0]], dtype=int) % md
p = np.matrix(np.identity(2), dtype=int)
while k:
    if k%2: p *= m; p %= md
    m *= m; m %= md
    k //= 2
print(p[0, 0])
0