\(RXD\ and\ functions\) Problem Description RXD has a polynomial function \(f(x)\), \(f(x)=\sum ^{n}_{i=0}c_ix_i\) RXD has a transformation of function \(Tr(f,a)\), it returns another function g, which has a property that \(g(x)=f(x−a)\). Given \(a_1…
RXD and functions Problem Description RXD has a polynomial function f(x), f(x)=∑ni=0cixiRXD has a transformation of function Tr(f,a), it returns another function g, which has a property that g(x)=f(x−a).Given a1,a2,a3,…,am, RXD generates a polynomial…
题意:给定一个n次多项式f(x)的各项系数,让你求f(x-Σai)的各项系数. http://blog.csdn.net/v5zsq/article/details/76780053 推导才是最关键的部分……我的数学推导能力很弱,比赛的时候很难推出来……尤其是累加变量交换顺序.换元这两个常用的技巧在配凑卷积形式以及莫比乌斯反演中都很常用 #include<cstdio> #include<cstring> #include<algorithm> using namesp…
每次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…
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…
题意 给定一个\(n​\) 次的 \(f​\) 函数,向右移动 \(m​\) 次得到 \(g​\) 函数,第 \(i​\) 次移动长度是 \(a_i​\) ,求 \(g​\) 函数解析式的各项系数,对 \(998244353​\) 取模. \(1 \leq n \leq 10^5\) \(1\leq \sum m \leq 10^5\) 思路 设 \(\displaystyle S=-\sum_{i=1}^ma_i\) \[ g(x)=f(x+S)\\ g(x)=\sum_{i=0}^nc_i(…
题解: 我是参考的 http://blog.csdn.net/qq_32570675/article/details/76571666 这一篇 orz 原来可以这么变换,涨姿势 代码: #include <iostream> #include <cstring> #include <cstdio> using namespace std; typedef long long LL; ; ; ; LL F[maxn*], G[maxn*], mul[maxn], imul…
题目链接:HDU-6061 题意:给定f(x),求f(x-A)各项系数. 思路:推导公式有如下结论: 然后用NTT解决即可. 代码: #include <set> #include <cmath> #include <queue> #include <stack> #include <vector> #include <string> #include <cstdio> #include <cstdlib> #…
划分出来的每个区间的答案,其实就是连续两个的lca的最小值. 即5 2 3 4 这个区间的答案是min(dep(lca(5,2)),dep(lca(2,3),dep(lca(3,4)))). 于是dp即可,f(i,j)表示前i个数,划分成j段的最优值. 只有三种决策,要么不取,继承f(i-1,j),要么将其自己作为某段的最小值,转移自f(i-1,j-1),要么将其与其前位的lca作为某段的最小值,转移自f(i-2,j-1). 如果用tarjan预处理相邻的lca的话,复杂度是O(n*K). 比s…
/*hdu6061[NTT推公式] 2017多校3*/ #include <bits/stdc++.h> using namespace std; typedef long long LL; ; ; int n, m, temp; LL a; LL inv[]; LL Finv[]; LL F[]; LL A[], B[], C[]; LL quickPow(LL x, LL n, LL MOD) { LL ans = ; ) { ) ans = (ans * x) % MOD; x = (x…