
快速幂
@Star
这个作者很懒,什么都没留下…
展开
-
HDU - 1061 快速幂签到题
Given a positive integer N, you should output the most right digit of N^N.InputThe input contains several test cases. The first line of the input is a single integer T which is the number of test...原创 2019-03-20 07:15:18 · 259 阅读 · 0 评论 -
HDU - 1575 Tr A(矩阵快速幂模板)
A为一个方阵,则Tr A表示A的迹(就是主对角线上各项的和),现要求Tr(A^k)%9973。Input数据的第一行是一个T,表示有T组数据。每组数据的第一行有n(2 <= n <= 10)和k(2 <= k < 10^9)两个数据。接下来有n行,每行有n个数据,每个数据的范围是[0,9],表示方阵A的内容。Output对应每组数据,输出Tr(A^k)%...原创 2019-03-20 07:15:03 · 130 阅读 · 0 评论