摘要:
题目链接: "HDU 1548" Description There is a strange lift.The lift can stop can at every floor as you want, and there is a number Ki(0 Here comes the probl 阅读全文
摘要:
题目链接: "HDU 2266" Description Now give you an string which only contains 0, 1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,9.You are asked to add the sign ‘+’ or ’ ’ between 阅读全文
摘要:
题目链接: "POJ 3641" Description Fermat's theorem states that for any prime number p and for any integer a 1, ap = a (mod p). That is, if we raise a to th 阅读全文
摘要:
题目链接: "POJ 1995" Description People are different. Some secretly read magazines full of interesting girls' pictures, others create an A bomb in their 阅读全文
摘要:
问题引入 快速幂用于求解 $a ^ n\ mod\ m$ 的结果。 朴素的做法是直接用循环求解,时间复杂度 $O(n)$。 可以发现上述代码有重复部分,还可以简化。 进一步优化 相关题目 "POJ 1995" 阅读全文