随笔分类 -  数论

摘要:题意就是求n的k次方的前三位和后三位 - 后三位快速幂取模就行。 - 前三位,首先pow(n,k)=pow(10,k*lg(n)),此时可以看出pow(n,k)的值的位数是由k *lg(n)的整数部分决定,而值是由其小数部分决定,因此只取前三位的话让k *lg(n)的... 阅读全文
posted @ 2017-08-22 20:57 ACagain 阅读(150) 评论(0) 推荐(0)
摘要:In mathematics, the nth harmonic number is the sum of the reciprocals of the first n natural numbers: In this problem, you are gi... 阅读全文
posted @ 2017-08-21 21:31 ACagain 阅读(1431) 评论(0) 推荐(0)
摘要:Goldbach's conjecture is one of the oldest unsolved problems in number theory and in all of mathematics. It states:Every even integer,... 阅读全文
posted @ 2017-08-21 21:25 ACagain 阅读(120) 评论(0) 推荐(0)