摘要:
Description The digital root of a positive integer is found by summing the digits of the integer. If the resulting value is a single digit then that d... 阅读全文
posted @ 2015-06-04 17:37
Vmetrio
阅读(212)
评论(0)
推荐(0)
摘要:
下面是 m^n % k 的快速幂: 1 // m^n % k 2 int quickpow(int m,int n,int k) 3 { 4 int b = 1; 5 while (n > 0) 6 { 7 if (n & 1) 8 ... 阅读全文
posted @ 2015-06-04 17:34
Vmetrio
阅读(187)
评论(0)
推荐(0)
摘要:
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 th... 阅读全文
posted @ 2015-06-04 17:30
Vmetrio
阅读(173)
评论(0)
推荐(0)
摘要:
DescriptionGiven a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7), the ma... 阅读全文
posted @ 2015-06-04 17:27
Vmetrio
阅读(209)
评论(0)
推荐(0)
摘要:
在网站上一直没有找到有关于快速幂算法的一个详细的描述和解释,这里,我给出快速幂算法的完整解释,用的是C语言,不同语言的读者只好换个位啦,毕竟读C的人较多~所谓的快速幂,实际上是快速幂取模的缩写,简单的说,就是快速的求一个幂式的模(余)。在程序设计过程中,经常要去求一些大数对于某个数的余数,为了得到更... 阅读全文
posted @ 2015-06-04 16:55
Vmetrio
阅读(474)
评论(0)
推荐(0)

浙公网安备 33010602011771号