随笔分类 - 数学-数论-快速幂
摘要:题目连接http://acm.hdu.edu.cn/showproblem.php?pid=2035人见人爱A^BDescription求A^B的最后三位数表示的整数。说明:A^B的含义是“A的B次方”Input输入数据包含多个测试实例,每个实例占一行,由两个正整数A和B组成(1#include#i...
阅读全文
摘要:题目连接http://acm.hdu.edu.cn/showproblem.php?pid=1575Tr ADescriptionA为一个方阵,则Tr A表示A的迹(就是主对角线上各项的和),现要求Tr(A^k)%9973。Input数据的第一行是一个T,表示有T组数据。每组数据的第一行有n(2 #...
阅读全文
摘要:题目连接http://acm.hdu.edu.cn/showproblem.php?pid=1061Rightmost DigitDescriptionGiven a positive integer N, you should output the most right digit of N^N....
阅读全文
摘要:题目连接http://acm.hdu.edu.cn/showproblem.php?pid=1005Number SequenceDescriptionA number sequence is defined as follows:f(1) = 1, f(2) = 1, f(n) = (A * f(...
阅读全文
摘要:题目连接http://poj.org/problem?id=3641Pseudoprime numbersDescriptionFermat's theorem states that for any prime numberpand for any integera> 1,ap=a(modp). ...
阅读全文
摘要:题目连接http://poj.org/problem?id=3070FibonacciDescriptionIn the Fibonacci integer sequence,F0= 0,F1= 1, andFn=Fn− 1+Fn− 2forn≥ 2. For example, the first ...
阅读全文

浙公网安备 33010602011771号