ACM集训-数学技巧
piekey1994
这个作者很懒,什么都没留下…
展开
-
HDU 1061 Rightmost Digit (四则运算求余,快速幂)
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原创 2014-08-08 09:53:47 · 615 阅读 · 0 评论 -
hdu 1005 Number Sequence(智寻循环节)
DescriptionA number sequence is defined as follows: f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7. Given A, B, and n, you are to calculate the value of f(n).原创 2014-08-08 10:12:05 · 408 阅读 · 0 评论 -
HDU 1757 A Simple Math Problem(矩阵快速幂)
DescriptionLele now is thinking about a simple function f(x).If x If x >= 10 f(x) = a0 * f(x-1) + a1 * f(x-2) + a2 * f(x-3) + …… + a9 * f(x-10);And ai(0Now, I will give a0 ~ a9 and two原创 2014-08-08 10:34:30 · 326 阅读 · 0 评论 -
ZOJ 3785 What day is that day?(费马小定理智寻循环节)
DescriptionIt's Saturday today, what day is it after 11 + 22 + 33 + ... +NN days? InputThere are multiple test cases. The first line of input contains an integer T indicating the n原创 2014-08-08 11:11:27 · 874 阅读 · 0 评论