HDU - 6063 RXD and math】的更多相关文章

比赛时候面向过题队伍数目 打表- - 看了题解发现确实是这么回事,分析能力太差.. /* HDU 6063 - RXD and math [ 数学,规律 ] | 2017 Multi-University Training Contest 3 题意: 求 Σ μ(i)^2 * sqrt( n^k/i ) [ 1 <= i<= n^k ] n,k <= 1e18 分析: 首先 μ(i) 为莫比乌斯函数,若 i 是完全平方数的倍数则 μ(i) = 0 ,否则 μ(i) = ±1 所以只有不是…
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−…
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…
题目链接 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…
HDU 5628 Clarke and math 本文属于一个总结了一堆做法的玩意...... 题目 简单的一个式子:给定$n,k,f(i)$,求 然后数据范围不重要,重要的是如何优化这个做法. 这个式子有$n$种问法,而且可以变式扩展,所以说这个式子也是比较重要的: 我们约定如果给定了$n,k$那么我们的$g$写作$g_k(n)$,如果给定了$n,k$中间的任意一个,枚举另一个,或者另一个是变化的,那么另一个数记为$i,j$ 把$1~n$或$1~k$的$g_k(i)$或$g_i(n)$都求出来…
2017 多校3 hdu 6061 RXD and functions(FFT) 题意: 给一个函数\(f(x)=\sum_{i=0}^{n}c_i \cdot x^{i}\) 求\(g(x) = f(x - \sum a_i)\)后每一项\(x^{i}\)的系数mod998244353 \(n <= 10^{5},m <= 10^{5}\) \(0 <= c_i < 998244353\) \(0 <= a_i < 998244353\) 思路: 令\(d = -\s…
每次NTT都忘记初始化,真的是写一个小时,Debug两个小时- - /* HDU 6061 - RXD and functions [ NTT ] | 2017 Multi-University Training Contest 3 题意: 给定多项式 F(x) = ∑[0<=i<=n] f(i)*x^i 求多项式 G(x) = F(x-a) n <= 1e5 分析: 设 G(x) = ∑ g(i)*x^i 将 F(x-a) 按二项式定理展开后易得: g(x) = ∑[x<=y&l…
/* HDU 6060 - RXD and dividing [ 分析,图论 ] | 2017 Multi-University Training Contest 3 题意: 给一个 n 个节点的树,要求将 2-n 号节点分成 k 部分,然后将每一部分加上节点 1, 每一个子树的 val 为最小斯坦纳树,求总的最大 val 分析: 考虑每条边下面所在的子树,大小为num 由于该子树至多被分成 k 块,故该边最多贡献 k 次,贡献次数当然是越多越好 所以每条边的贡献为 w * min(k, num…
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\)中的某个不…