摘要:
快速幂 首先,快速幂是用来解决什么问题的? 给定三个正整数a、b、m(a<109,b<1018,1<m<109),求ab%m 对于这个问题,如果使用暴力来处理显然是不行的,O(b)的复杂度支持b<108都已经很艰难了,更何况1018 快速幂的做法是基于二分的思想,因此也常称为二分幂。快速幂基于一下事 阅读全文
posted @ 2020-03-10 22:16
Hu_YaYa
阅读(226)
评论(0)
推荐(0)
摘要:
1038 Recover the Smallest Number (30分) Given a collection of number segments, you are supposed to recover the smallest number from... 阅读全文
posted @ 2020-03-10 15:21
Hu_YaYa
阅读(22)
评论(0)
推荐(0)
摘要:
1067 Sort with Swap(0, i) (25分) Given any permutation of the numbers {0, 1, 2,..., N−1}, it is easy to sort them in increasing ord... 阅读全文
posted @ 2020-03-10 14:42
Hu_YaYa
阅读(38)
评论(0)
推荐(0)
摘要:
1037 Magic Coupon (25分) The magic shop in Mars is offering some magic coupons. Each coupon has an integer N printed on it, meaning... 阅读全文
posted @ 2020-03-10 13:47
Hu_YaYa
阅读(11)
评论(0)
推荐(0)
摘要:
1070 Mooncake (25分) Mooncake is a Chinese bakery product traditionally eaten during the Mid-Autumn Festival. Many types of filling... 阅读全文
posted @ 2020-03-10 12:01
Hu_YaYa
阅读(20)
评论(0)
推荐(0)

浙公网安备 33010602011771号