经典指数          
POJ
原因
426
浏览数
0
收藏数
 

Given a n × n matrix A and a positive integer k, find the sum S = A + A 2 + A 3 + … + Ak . 输入描述 The input contains exactly one test case. The first line of input contains three positive integers n (n ≤ 30), k (k ≤ 109) and m (m < 104). Then follow n lines each containing n nonnegative integers below 32,768, giving A’s elements in row-major order. 输出描述 Output the elements of S modulo m in the same way as A is given. 输入例子 2 2 4 0 1 1 1 输出例子 1 2 2 3

     举报   纠错  
 
切换
暂时还没有答案,欢迎分享你的解答 . . .
撰写答案
扫描后移动端查看本题