摘要: 题目: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 阅读(129) 评论(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 阅读(208) 评论(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 阅读(157) 评论(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 阅读(124) 评论(0) 推荐(0) 编辑
摘要: 题目:https://www.lydsy.com/JudgeOnline/problem.php?id=4503 推式子即可; 不知怎的调了那么久,应该是很清晰的。 代码如下: 阅读全文
posted @ 2018-11-27 00:10 Zinn 阅读(116) 评论(0) 推荐(0) 编辑