86分 不知道哪里错
N,M=map(int,input().split())
a=[]
for i in range(N):
a.append(list(map(int,input().split())))
a1=[[0 for _ in range(N)] for _ in range(N)]
result=[[0 for _ in range(N)] for _ in range(N)]
for i in range(N):
for j in range(N):
a1[i][j]=a[i][j]
def cheng(a1,a):
for i in range(N):
for j in range(N):
result[i][j]=sum(a1[i][k]*a[k][j] for k in range(N))
return result
def mi(a1,a,M):
while M>1:
result=cheng(a1,a)
for i in range(N):
for j in range(N):
a1[i][j]=result[i][j]
M-=1