If we represent a date in the format YYYY-MM-DD (for example, 2017-04-09), do you know how many 9s will appear in all the dates between Y1-M1-D1 and Y2-M2-D2 (both inclusive)? Note that you should take leap years into consideration. A leap year is a…
Problem Description RXD is a good mathematician.One day he wants to calculate: ∑i=1nkμ2(i)×⌊nki−−−√⌋ output the answer module 109+7.1≤n,k≤1018 μ(n)=1(n=1) μ(n)=(−1)k(n=p1p2…pk) μ(n)=0(otherwise) p1,p2,p3…pk are different prime numbers Input There a…
http://www.lydsy.com/JudgeOnline/problem.php?id=4547 本蒟蒻并不会矩乘求Fibonacci数列前缀和,所以果断分块打表,常数竟然比矩乘要小! PS:今天是长者90岁大寿,+1s #include<cstdio> #include<cstring> #include<algorithm> using namespace std; const int p = 10000007; const int bef[1002] =…
Some positive integers can be represented by a sum of one or more consecutive prime numbers. How many such representations does a given positive integer have? For example, the integer 53 has two representations 5 + 7 + 11 + 13 + 17 and 53. The intege…