RXD and math Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 568 Accepted Submission(s): 306 Problem Description RXD is a good mathematician.One day he wants to calculate: ∑i=1nkμ2(i)×⌊nki−…
RXD and math 题目链接 思路 \(u\)函数是莫比乌斯函数,这个不影响做题,这个式子算的是\([1,n^k]\)中能够写成\(a*b^2\)的数的个数,\(u(a)!=0\).然后我们可以证明任何数都可以唯一写成\(a*b^2\)的形式,因为\(b = p1*p2*..pn\),假设\(a\)中没有\(b\)中的因子,那么肯定是唯一表示的,如果含有\(b\)中的因子如果表示的形式要变,那么肯定要将\(b\)改变,那么如果\(b\)改变的话假设将任意一个\(p\)和\(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…
题目链接 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 Th…
RXD is a good mathematician. One day he wants to calculate: output the answer module 109+7. p1,p2,p3-pk are different prime numbers Input There are several test cases, please keep reading until EOF. There are exact 10000 cases. For each test case, th…
Bryce1010模板 http://acm.hdu.edu.cn/showproblem.php?pid=6063 打表发现规律是n^k #include <iostream> #include<string.h> #include<cmath> using namespace std; #define ll long long const int MOD=1e9+7; const int MAXN=1e6; bool check[MAXN+10]; int prim…
[Link]: [Description] [Solution] 发现1010mod(109+7)=999999937; 猜测答案是nk 写个快速幂; 注意对底数先取模; [NumberOf WA] 1 [Reviw] 看到过的人那么多就应该想到找规律的. 大胆猜测 [Code] #include <bits/stdc++.h> using namespace std; #define int long long const int MOD = 1e9+7; int n,k; int get_…