随笔分类 - 数论 - FFT / NTT / FWT
摘要:#include using namespace std; #define ll long long const ll maxn = 3e5+5; const ll mod = 1e9+7; ll n; ll a[maxn], b[maxn]; void fwt(ll *a) { for(ll d=1;d>= 1; } return res; } int main (...
阅读全文
摘要:A. 链接:https://www.nowcoder.com/acm/contest/147/A来源:牛客网 题目描述 Niuniu has recently learned how to use Gaussian elimination to solve systems of linear equ
阅读全文
摘要:「BZOJ2194」快速傅立叶之二 2015年4月29日3,8300 Description 请计算C[k]=sigma(a[i]*b[i-k]) 其中 k < = i < n ,并且有 n < = 10 ^ 5。 a,b中的元素均为小于等于100的非负整数。 请计算C[k]=sigma(a[i]*
阅读全文
摘要:HDU 1402 A * B Problem Plus Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 26545 Accepted Submis
阅读全文
摘要:使用NTT需要保证模数mod 为质数。 通过以下代码求得一个模数的原根 , 常见的质数的原根 998244353 -> 3 1e9+7 -> 5 g是mod(r * 2 ^ k + 1)的原根 r * 2 ^ k + 1 r k g 3 1 1 2 5 1 2 2 17 1 4 3 97 3 5 5
阅读全文
摘要:链接:https://www.nowcoder.com/acm/contest/133/D来源:牛客网 题目描述 Applese打开了m个QQ群,向群友们发出了组队的邀请。作为网红选手,Applese得到了n位选手的反馈,每位选手只会在一个群给Applese反馈 现在,Applese要挑选其中的k名
阅读全文
摘要:推荐博客 : https://oi.men.ci/fft-notes/ 卷积的理解 : https://www.zhihu.com/question/22298352?rf=21686447 题目链接 :http://uoj.ac/problem/34 这是一道模板题。给你两个多项式,请输出乘起来后
阅读全文