
快速幂
深海幽藍
ACMer
展开
-
HDU-1061 Rightmost Digit(快速幂取余)
Problem DescriptionGiven 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 th...原创 2018-04-24 16:42:16 · 196 阅读 · 0 评论 -
矩阵快速幂模板
矩阵快速幂和普通的快速幂差不多,注意单位矩阵E是对角线都是1、其他是零的矩阵#include<bits/stdc++.h> using namespace std; const int maxn = 100 + 10; int MOD; struct Mat { int a[maxn][maxn]; int n, m;//n为行数,m为列数 Mat(int n,...转载 2018-04-29 20:54:38 · 137 阅读 · 0 评论