Rightmost Digit Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 69614 Accepted Submission(s): 25945 Problem Description Given a positive integer N, you should output the most right digit of N…
链接: https://vjudge.net/problem/LightOJ-1282 题意: You are given two integers: n and k, your task is to find the most significant three digits, and least significant three digits of nk. 思路: 后三位快速幂取余,考虑前三位. \(n^k\)可以表示为\(a*10^m\)即使用科学计数法. 对两边取对数得到\(k*log…
2013长春赛区网络赛的1009题 比赛的时候这道题英勇的挂掉了,原因是写错了一个系数,有时候粗心比脑残更可怕 本题是关于Bell数,关于Bell数的详情请见维基:http://en.wikipedia.org/wiki/Bell_number 其中有一句话是这么说的: And they satisfy "Touchard's congruence": If p is any prime bumber then 但95041567不是素数, 分解之后发现 95041567 = 31 ×…