快速幂
veget_chicken
这个作者很懒,什么都没留下…
展开
-
Prime Land
链接:http://acm.hust.edu.cn/vjudge/problem/21459/origin题目:Everybody in the Prime Land is using a prime base number system. In this system, each positive integer x is represented as follows: Let {pi}原创 2016-08-31 20:41:17 · 296 阅读 · 0 评论 -
Happy 2004
链接:http://acm.hust.edu.cn/vjudge/problem/40652/origin题目:Consider a positive integer X,and let S be the sum of all positive integer divisors of 2004^X. Your job is to determine S modulo 29 (the res原创 2016-08-31 21:36:01 · 280 阅读 · 0 评论 -
人见人爱A^B
链接:http://acm.hust.edu.cn/vjudge/problem/17489/origin题目:求A^B的最后三位数表示的整数。 说明:A^B的含义是“A的B次方”题意:。分析:这是数论里面的模运算定理,模运算在加减乘三运算中满足分配律,可以任意分配,注意除法不可以用分配律,在遇到除法时要用群概念中的逆元来变成乘法。此外i,本体要用快速幂来优化。原创 2016-08-31 20:17:49 · 149 阅读 · 0 评论