上一页 1 2 3 4 5 6 ··· 24 下一页
摘要: "传送门" Solution 前几天刚做了类似题,这种将一个序列拆分为两个单调序列的题一般都是设$dp[i]$表示i为一个单调序列的末尾时,另一个序列的末尾是多少 然后应用贪心的思想,在这道题中就是让另一个序列末尾最小。 另外这道题还有长度的限制,不过由于总长知道,只需记其中一个的序列长度即可 Co 阅读全文
posted @ 2018-10-18 15:06 Menteur_hxy 阅读(201) 评论(0) 推荐(0) 编辑
摘要: "传送门" Solution 一位一位考虑,直接得到答案中第i为是否为1 Code cpp //By Menteur_Hxy include include include include include include include define Re register define Ms(a, 阅读全文
posted @ 2018-10-17 22:29 Menteur_hxy 阅读(239) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2018-10-17 20:26 Menteur_hxy 阅读(3) 评论(1) 推荐(0) 编辑
摘要: "传送门" Solution 卡特兰数 排队问题的简单变化 答案为$C_{2n}^n \pmod p$ 由于没有逆元,只好用分解质因数,易证可以整除 Code 阅读全文
posted @ 2018-10-17 20:07 Menteur_hxy 阅读(182) 评论(0) 推荐(0) 编辑
摘要: "传送门" Solution 2D BIT模板 Code cpp //By Menteur_Hxy include include include include include include define Re register define Ms(a,b) memset(a,(b),sizeo 阅读全文
posted @ 2018-10-16 16:12 Menteur_hxy 阅读(119) 评论(0) 推荐(0) 编辑
摘要: "传送门" Solution 对于硬币问题,结论是:当前局面的SG值等于所有背面朝上的单个硬币SG值的异或和 对于求单个背面朝上的硬币SG值。。。打表找规律吧 Code cpp //By Menteur_Hxy include include include include include incl 阅读全文
posted @ 2018-10-16 15:41 Menteur_hxy 阅读(227) 评论(0) 推荐(0) 编辑
摘要: "传送门" Solution 画图找规律。。 Code cpp //By Menteur_Hxy include define min(a,b) ((a) (b)?(b):(a)) int main() { int n,k;scanf("%d %d",&n,&k); printf("%d",n==1 阅读全文
posted @ 2018-10-16 15:04 Menteur_hxy 阅读(148) 评论(0) 推荐(0) 编辑
摘要: "传送门" Solution 我们知道当SG不为0则先手必胜,然后就可以打表了 ̄▽ ̄ Code 阅读全文
posted @ 2018-10-13 22:58 Menteur_hxy 阅读(115) 评论(0) 推荐(0) 编辑
摘要: "传送门" Solution 显然每个点的权值可以由当前点上下左右的树的数量用组合数$O(1)$求出,但这样枚举会T 那么我们考虑一段连续区间,对于一行中两个常青树中间的部分左右树的数量一定,我们可用树状数组求区上下贡献值和,相乘就得到了当前区间的贡献。 ~~有思路调不出来系列~~ Code cpp 阅读全文
posted @ 2018-10-13 22:46 Menteur_hxy 阅读(132) 评论(0) 推荐(0) 编辑
摘要: "传送门" Solution 十分简单的树形dpQwQ,转移关系:父亲染了儿子不用染 只需要确定根就是简单树形dp,而其实根可以随便取一个非叶子节点 可以分情况讨论发现答案并不会改变 Code cpp //By Menteur_Hxy include include include include 阅读全文
posted @ 2018-10-11 23:40 Menteur_hxy 阅读(216) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 24 下一页