上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 73 下一页
摘要: 题目:https://www.lydsy.com/JudgeOnline/problem.php?id=4589 先手必败,是一开始所有石子的异或和为0; 生成函数 (xpri[1] + xpri[2] + ... + xpri[k])n,pri[k] <= m FWT求解即可; 而且不要快速幂里面 阅读全文
posted @ 2018-11-29 18:07 Zinn 阅读(179) 评论(0) 推荐(0) 编辑
摘要: FWT求解的是一类问题:\( a[i] = \sum\limits_{j\bigoplus k=i}^{} b[j]*c[k] \) 其中,\( \bigoplus \) 可以是 or,and,xor 三种问题的解决思路都是对多项式 \( a \) 构造一个 \( a' \),令 \( a' = b 阅读全文
posted @ 2018-11-29 16:34 Zinn 阅读(374) 评论(0) 推荐(0) 编辑
摘要: 题目: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) 编辑
摘要: 题目:https://www.lydsy.com/JudgeOnline/problem.php?id=5092 首先,处理出异或前缀和 s[i],i 位置的答案就是 s[j] + s[j]^s[i],j <= i 异或的套路是按位考虑,但是这里有加法...怎么考虑进位? 所以就不能考虑答案的这一位 阅读全文
posted @ 2018-11-27 23:47 Zinn 阅读(128) 评论(1) 推荐(1) 编辑
摘要: 题目:https://www.lydsy.com/JudgeOnline/problem.php?id=3027 就是 (1+x+x2+...+xm[i]) 乘起来; 原来想和背包一样做,然而时限很短,数组也开不了很多,本来以为勉强一下也可以,后来突然发现不行... #include<iostrea 阅读全文
posted @ 2018-11-27 20:50 Zinn 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 题目:https://www.lydsy.com/JudgeOnline/problem.php?id=3028 式子很好推,详细可以看这篇博客:https://blog.csdn.net/wu_tongtong/article/details/78856565 所以就是要求 C(n+2,3) ,n 阅读全文
posted @ 2018-11-27 15:18 Zinn 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 题目:http://acm.hdu.edu.cn/showproblem.php?pid=1028 整数划分,每个数可以用无限次; 所以构造 f(x) = (1+x+x2+x3+...)(1+x2+x4+...)(1+x3+x6+...)...(1+xn) 乘起来后的 xn 的系数就是方案数; 用两 阅读全文
posted @ 2018-11-27 11:48 Zinn 阅读(348) 评论(0) 推荐(0) 编辑
摘要: 题目:https://www.lydsy.com/JudgeOnline/problem.php?id=4827 首先,旋转对应,可以把 b 序列扩展成2倍,则 a 序列对应到的还是一段区间; 再把 a 序列翻转,就成了卷积的形式; 如果 b 从 k 位置断开,则值为 ∑(0<=i<=n) (a[n 阅读全文
posted @ 2018-11-27 09:34 Zinn 阅读(122) 评论(0) 推荐(0) 编辑
上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 73 下一页