結果

問題 No.997 Jumping Kangaroo
ユーザー chinchillachinchilla
提出日時 2020-02-23 00:37:53
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 389 bytes
コンパイル時間 405 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 44,468 KB
最終ジャッジ日時 2024-04-18 08:07:00
合計ジャッジ時間 17,231 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 475 ms
44,344 KB
testcase_01 AC 471 ms
43,964 KB
testcase_02 AC 501 ms
44,348 KB
testcase_03 AC 505 ms
43,964 KB
testcase_04 AC 513 ms
43,956 KB
testcase_05 AC 486 ms
43,964 KB
testcase_06 AC 470 ms
44,216 KB
testcase_07 AC 471 ms
44,092 KB
testcase_08 AC 493 ms
44,060 KB
testcase_09 AC 463 ms
43,968 KB
testcase_10 AC 460 ms
43,956 KB
testcase_11 AC 466 ms
44,352 KB
testcase_12 AC 461 ms
44,216 KB
testcase_13 AC 477 ms
44,344 KB
testcase_14 AC 491 ms
44,468 KB
testcase_15 AC 507 ms
43,956 KB
testcase_16 AC 487 ms
44,352 KB
testcase_17 AC 495 ms
43,960 KB
testcase_18 AC 490 ms
43,968 KB
testcase_19 AC 486 ms
43,956 KB
testcase_20 AC 467 ms
43,968 KB
testcase_21 AC 510 ms
44,340 KB
testcase_22 AC 484 ms
44,084 KB
testcase_23 RE -
testcase_24 AC 487 ms
44,348 KB
testcase_25 AC 490 ms
44,268 KB
testcase_26 AC 472 ms
44,084 KB
testcase_27 AC 507 ms
43,960 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]
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