結果

問題 No.997 Jumping Kangaroo
ユーザー chinchillachinchilla
提出日時 2020-02-23 01:03:41
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 528 ms / 2,000 ms
コード長 398 bytes
コンパイル時間 344 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 44,592 KB
最終ジャッジ日時 2024-04-18 08:07:22
合計ジャッジ時間 15,920 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 499 ms
44,216 KB
testcase_01 AC 511 ms
44,212 KB
testcase_02 AC 513 ms
43,948 KB
testcase_03 AC 506 ms
43,944 KB
testcase_04 AC 510 ms
44,072 KB
testcase_05 AC 504 ms
44,084 KB
testcase_06 AC 508 ms
44,468 KB
testcase_07 AC 505 ms
44,340 KB
testcase_08 AC 508 ms
43,944 KB
testcase_09 AC 508 ms
44,584 KB
testcase_10 AC 528 ms
44,372 KB
testcase_11 AC 513 ms
43,956 KB
testcase_12 AC 506 ms
43,948 KB
testcase_13 AC 510 ms
43,952 KB
testcase_14 AC 513 ms
43,952 KB
testcase_15 AC 512 ms
44,208 KB
testcase_16 AC 507 ms
44,340 KB
testcase_17 AC 505 ms
44,332 KB
testcase_18 AC 509 ms
43,948 KB
testcase_19 AC 503 ms
44,592 KB
testcase_20 AC 514 ms
43,948 KB
testcase_21 AC 511 ms
43,952 KB
testcase_22 AC 508 ms
43,948 KB
testcase_23 AC 506 ms
44,216 KB
testcase_24 AC 505 ms
44,344 KB
testcase_25 AC 512 ms
43,948 KB
testcase_26 AC 502 ms
43,952 KB
testcase_27 AC 506 ms
44,332 KB
権限があれば一括ダウンロードができます

ソースコード

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] % md
g2 = (L[w*2] - L[w]**2) % md
m = np.matrix([[g1, g2], [1, 0]], dtype=int)
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