Submission #19683953


Source Code Expand

Copy
import numpy
k, n = map(int, input().split())
if n <= k:
    print(1)
    exit()
a = numpy.array([[1 if i == 0 or i - 1 == j else 0 for j in range(k)] for i in range(k)])
a = numpy.linalg.matrix_power(a, n - k)
a = numpy.dot(a, numpy.array([1] * k))
print(a[0])

Submission Info

Submission Time
Task T - フィボナッチ
User spring1105
Language Python (3.8.2)
Score 0
Code Size 269 Byte
Status TLE
Exec Time 2207 ms
Memory 50996 KB

Judge Result

Set Name All
Score / Max Score 0 / 8
Status
AC × 3
TLE × 4
Set Name Test Cases
All 00, 01, 02, 03, 04, 90, 91
Case Name Status Exec Time Memory
00 TLE 2206 ms 50996 KB
01 TLE 2206 ms 42352 KB
02 TLE 2207 ms 48928 KB
03 TLE 2206 ms 32104 KB
04 AC 113 ms 26828 KB
90 AC 111 ms 27096 KB
91 AC 110 ms 26932 KB