摘要: 分析:这一题和HDU3047一样,都是带权并查集,求后输入和先输入的冲突个数 然后其实就是用并查集维护一棵树,小的作为大的祖先,然后这棵树每个节点到根的路径权值是相对根节点的距离 这样就可以维护距离限制,判断冲突 #include <cstdio> #include <cstring> #inclu 阅读全文
posted @ 2016-05-04 19:54 shuguangzw 阅读(108) 评论(0) 推荐(0) 编辑
摘要: 转:http://blog.csdn.net/shuangde800/article/details/7983965 #include <cstdio> #include <cstring> #include <queue> #include <set> #include <map> #includ 阅读全文
posted @ 2016-05-04 19:49 shuguangzw 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 因为只有1e5个点,所以直接离散化bfs就好 #include <cstdio> #include <cstring> #include <queue> #include <set> #include <map> #include <stack> #include <cstdlib> #includ 阅读全文
posted @ 2016-05-04 16:12 shuguangzw 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 分析:这种题烂大街,n^2,然后数据结构优化下到nlogn,离散化 #include <cstdio> #include <cstring> #include <queue> #include <set> #include <map> #include <stack> #include <cstdl 阅读全文
posted @ 2016-05-04 15:35 shuguangzw 阅读(195) 评论(0) 推荐(0) 编辑
摘要: 题意:先去再回,不能吃重复的,获取最大值 分析:等价于两个人同时去,不能吃重复的 定义dp[i][j][k]表示从起点走k步,第一个人的横坐标是i,第二个人的横坐标是j的最最大值 这个题和bc上一个回文串的题是一样的 #include <cstdio> #include <cstring> #inc 阅读全文
posted @ 2016-05-04 14:58 shuguangzw 阅读(219) 评论(0) 推荐(0) 编辑
摘要: 分析:http://blog.csdn.net/chenzhenyu123456/article/details/51308460 #include <cstdio> #include <cstring> #include <queue> #include <set> #include <map> 阅读全文
posted @ 2016-05-04 14:03 shuguangzw 阅读(169) 评论(0) 推荐(0) 编辑