上一页 1 ··· 29 30 31 32 33 34 35 36 37 ··· 52 下一页
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1558先判断线段相交,然后用并查集合并。 1 #include 2 #include 3 #include 4 #define maxn 20000 5 using namespace std; 6 7 i... 阅读全文
posted @ 2014-05-13 20:47 null1019 阅读(136) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1272 1 #include 2 #include 3 #include 4 #define maxn 50000 5 using namespace std; 6 7 int in[maxn... 阅读全文
posted @ 2014-05-08 21:17 null1019 阅读(99) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1325 1 #include 2 #include 3 #include 4 #define maxn 5000 5 using namespace std; 6 7 int in[maxn]... 阅读全文
posted @ 2014-05-08 21:13 null1019 阅读(117) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1213 1 #include 2 #include 3 #include 4 #define maxn 2000 5 using namespace std; 6 7 int f[maxn],n,m; 8 ... 阅读全文
posted @ 2014-05-07 20:12 null1019 阅读(121) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=3047带权并差集 1 #include 2 #include 3 #include 4 #define maxn 60000 5 using namespace std; 6 7 int f[maxn],d... 阅读全文
posted @ 2014-05-07 19:48 null1019 阅读(118) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=3635 1 #include 2 #include 3 #include 4 #define maxn 20000 5 using namespace std; 6 7 int f[maxn]; 8 int... 阅读全文
posted @ 2014-05-07 18:50 null1019 阅读(107) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1856这道题就是求一个集合里面最大的个数。 基本的并查集加一个步骤,将合并后的元素的个数保存在新的树根中。 1 #include 2 #include 3 #include 4 #define maxn 10... 阅读全文
posted @ 2014-05-06 20:57 null1019 阅读(134) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1690 1 #include 2 #include 3 #include 4 #include 5 #include 6 #define maxn 500 7 #define LL __int64 8 u... 阅读全文
posted @ 2014-05-06 19:43 null1019 阅读(140) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=3191这道题求次短路经和路径数 1 #include 2 #include 3 #include 4 #include 5 #include 6 #define maxn 2000 7 us... 阅读全文
posted @ 2014-05-06 18:58 null1019 阅读(174) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1688这道题就是求最短路路径和次短路路径的条数。用一个二维数组记录每一个节点距离起始点的最短距离和次短距离,再开一个二维数组记录路径数更新状态时:1)新值小于最短路径长:更新最短路径长,计数;次短路径长,计数2)新... 阅读全文
posted @ 2014-05-06 18:54 null1019 阅读(391) 评论(0) 推荐(0) 编辑
上一页 1 ··· 29 30 31 32 33 34 35 36 37 ··· 52 下一页