上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 26 下一页
摘要: 传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=1070 【题解】 建图非常巧妙 需要仔细思考 我们考虑对第i个工人,倒数第j次修车建点,对于这里面每个点,连到T,流量1费用0表示只能用一次(废话)。 对于每辆车k,都可以连到这个点,流量1,费 阅读全文
posted @ 2017-06-01 15:27 Galaxies 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=1066 【题解】 网络流,考虑建模,拆点来满足限制跳多少次即可。 第2000个AC! # include <queue> # include <stdio.h> # include <strin 阅读全文
posted @ 2017-06-01 14:48 Galaxies 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=1123 【题解】 tarjan算割点的时候顺便统计即可。 割点的条件是 low[to[i]]>=dfn[x],说明删掉点x这一段就不和其他联通了。 先算不包含祖先的其他连通块的贡献,最后加包含祖 阅读全文
posted @ 2017-06-01 14:28 Galaxies 阅读(375) 评论(0) 推荐(0) 编辑
摘要: 传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=1558 【题解】 这题恶心死人了啊。。 网络上题解很多都是看代码看代码。。真是太不负责任了。。我这里详细说一下吧。。 题解在代码下面。 # include <stdio.h> # include 阅读全文
posted @ 2017-06-01 11:04 Galaxies 阅读(911) 评论(0) 推荐(3) 编辑
摘要: 传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=4418 【题解】 被题目名称吓死系列。 用一棵线段树维护当前有哪些半径。 那么将扇形差分,每段空白区域相当于查询线段树内第K大。 权值线段树就行啦! O(nlogn) # include <st 阅读全文
posted @ 2017-05-31 21:37 Galaxies 阅读(194) 评论(0) 推荐(0) 编辑
摘要: 传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=4915 【题解】 出自第52届IMO试题第1题。 首先第一问一定是4(样例给你了啊),如果要你证明, 我们不妨令a1<a2<a3<a4 那么有S=a1+a2+a3+a4 S/2=a1/2+a2/ 阅读全文
posted @ 2017-05-31 17:13 Galaxies 阅读(611) 评论(0) 推荐(0) 编辑
摘要: 传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=4419 【题解】 这是直接关系啊。。。 用n个set维护每个人的朋友关系,a[i]表示i在现在的时候发微博数量,那么添加的时候ans[x]-=a[y],删除的时候ans[x]+=a[y] 注意有 阅读全文
posted @ 2017-05-31 16:34 Galaxies 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=3702 【题解】 卧槽这竟然是bzoj的题(没想到) 啊很明显我们对于每个节点 判断一下两边交换/不交换哪个逆序对贡献的少就行了 至于这个逆序对贡献啊?线段树合并! 啊我不会线段树合并啊?启发式 阅读全文
posted @ 2017-05-31 15:29 Galaxies 阅读(278) 评论(0) 推荐(0) 编辑
摘要: 传送门: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) 编辑
上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 26 下一页