矩阵快速幂模板题
摘要:题目描述 God Water likes to eat meat, fish and chocolate very much, but unfortunately, the doctor tells him that some sequence of eating will make them po
阅读全文
矩阵快速幂模板
摘要:struct Mat { LL m[101][101]; };//存储结构体 Mat a,e; //a是输入的矩阵,e是输出的矩阵 Mat Mul(Mat x,Mat y) { Mat c; for(int i=1;i>=1; } return ans; }
阅读全文
十进制快速幂
摘要:给你一个大数n,求2的n次幂; 由于n很大,用普通的快速幂已经不能够很快的算出了,因为不好判断奇偶以及除2这些,不过不过用十进制快速幂求普通的ll及int型数也很快;
阅读全文
用唯一分解定理求m/n
摘要:用唯一分解定理求m/n,保证m能够被n整除; 这其中用到了素数筛以及快速幂
阅读全文