摘要: 题目:https://www.luogu.org/problemnew/show/P4245 用三模数NTT做,需要注意时间和细节; 注意各种地方要取模!传入 upt() 里面的数一定要不超过2倍 mod! 乘法会爆 long long 时用快速乘! 两次合并的模数,第一次是 (ll) p1*p2, 阅读全文
posted @ 2018-11-28 23:22 Zinn 阅读(342) 评论(0) 推荐(0) 编辑
摘要: 题目:https://www.lydsy.com/JudgeOnline/problem.php?id=3992 (学习NTT:https://riteme.github.io/blog/2016-8-22/ntt.html https://www.cnblogs.com/Mychael/p/929 阅读全文
posted @ 2018-11-28 18:23 Zinn 阅读(452) 评论(0) 推荐(0) 编辑
摘要: 题目:https://www.lydsy.com/JudgeOnline/problem.php?id=3771 令多项式的系数是方案数,次数是值; 设 a(x) 为一个物品的多项式,即 a[w[i]].x = 1,b(x) 为两个物品重复的多项式,即 b[w[i]*2].x = 1,c(x) 为三 阅读全文
posted @ 2018-11-28 10:24 Zinn 阅读(131) 评论(0) 推荐(0) 编辑