摘要: 传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=4417 【题解】 令f[i,j]表示到第2i-1列第j行的方案数,g[i,j]表示到第2i行第j列的方案数。 那么有 f[i,j]=Σg[1..i-1,j]+Σg[1..i-1,j-1]+Σg[ 阅读全文
posted @ 2017-05-30 22:38 Galaxies 阅读(2093) 评论(0) 推荐(0) 编辑
摘要: 传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=4415 【题解】 无脑写了splay。听说splay被卡?加了读入优化和一坨static就过了啊。。 10s卡着时限过 # include <stdio.h> # include <string 阅读全文
posted @ 2017-05-30 20:06 Galaxies 阅读(265) 评论(0) 推荐(0) 编辑
摘要: 传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=4423 【题解】 转对偶图,格子当成点,就相当于并查集裸题了。。 # include <stdio.h> # include <string.h> # include <iostream> # 阅读全文
posted @ 2017-05-30 18:03 Galaxies 阅读(186) 评论(0) 推荐(0) 编辑
摘要: 传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=3643 【题解】 n = p1^a1*p2^a2*...*pm^am phi(n) = p1(p1-1)^(a1-1)*p2(p2-1)^(a2-1)*...*pm^(am-1) 最多有10个不 阅读全文
posted @ 2017-05-30 17:16 Galaxies 阅读(277) 评论(0) 推荐(0) 编辑
摘要: 传送门:http://acm.hdu.edu.cn/showproblem.php?pid=1024 http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1053 【题解】 原来的解法:http://www.cnblogs.co 阅读全文
posted @ 2017-05-30 15:09 Galaxies 阅读(260) 评论(0) 推荐(0) 编辑
摘要: 传送门:http://acm.hdu.edu.cn/showproblem.php?pid=1024 http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1053 【题解】 本题也是51nod 1053 最大m子段和 和上题很像 阅读全文
posted @ 2017-05-30 11:49 Galaxies 阅读(274) 评论(0) 推荐(0) 编辑
摘要: 传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=3638 【题解】 看到k<=20就感觉很py了啊 我们用一棵线段树维护选段的过程,能选到>0的段就一直选,直到选到<0的段,每次选完把段内的数全部取相反数,意为下次取是“不取”的意思。 用线段树 阅读全文
posted @ 2017-05-30 10:18 Galaxies 阅读(386) 评论(0) 推荐(0) 编辑