上一页 1 ··· 51 52 53 54 55 56 57 58 59 ··· 64 下一页
摘要: Sample Input5 61 2 3 4 5Q 1 5 //1-5结点的最大值U 3 6 //将点3的数值换成6Q 3 4Q 4 5U 2 9Q 1 5 Sample Output5659 1 # include 2 # include 3 # include 4 # include 5... 阅读全文
posted @ 2015-06-26 20:20 __Meng 阅读(158) 评论(0) 推荐(0) 编辑
摘要: Sample Input1101 2 3 4 5 6 7 8 9 10Query 1 3Add 3 6Query 2 7Sub 10 2Add 6 3Query 3 10End Sample OutputCase 1:63359 1 # include 2 # include 3 # incl... 阅读全文
posted @ 2015-06-26 19:37 __Meng 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 求当前结点到根节点的距离Sample Input 2 1 //n m 1 2 1 2 //询问 5 2 1 2 1 3 3 4 3 5 4 2 //询问 4 5 0 0 Sample Output lxh pfz lxh 1 # include 2 # include 3 # include ... 阅读全文
posted @ 2015-06-24 23:40 __Meng 阅读(347) 评论(0) 推荐(0) 编辑
摘要: 求连通分量Sample Input10 91 21 31 41 51 61 71 81 91 1010 42 34 54 85 80 0Sample OutputCase 1: 1Case 2: 7 1 # include 2 # include 3 # include 4 # include... 阅读全文
posted @ 2015-06-24 22:54 __Meng 阅读(212) 评论(0) 推荐(0) 编辑
摘要: 求0号结点所在集合的元素个数Sample Input100 42 1 25 10 13 11 12 142 0 12 99 2200 21 55 1 2 3 4 51 00 0Sample Output411 1 # include 2 # include 3 # include 4 # in... 阅读全文
posted @ 2015-06-24 20:55 __Meng 阅读(231) 评论(0) 推荐(0) 编辑
摘要: 求集合里元素的个数 输出最大的个数是多少Sample Input41 23 45 61 641 23 45 67 8 Sample Output42 1 # include 2 # include 3 # include 4 # include 5 # include 6 # includ... 阅读全文
posted @ 2015-06-24 20:22 __Meng 阅读(216) 评论(0) 推荐(0) 编辑
摘要: 求连通分量Sample Input2 //T5 3 //n m1 2// u v2 34 55 12 5 Sample Output24 1 # include 2 # include 3 # include 4 # include 5 # include 6 # include 7 ... 阅读全文
posted @ 2015-06-23 21:57 __Meng 阅读(342) 评论(0) 推荐(0) 编辑
摘要: 题目大意:给你N台电脑,从1-N。一个数字,表示两台计算机的最大通信距离,超过这个距离就无法进行通信。然后分别告诉这些电脑的坐标,接下来有两种操作,第一种O表示这点电脑修好,第二种S,表示测试这两台电脑能不能进行正常的通信修电脑就是把这点加入到图中,S 就是判断这两个结点在不在同一个集合里,也就是是... 阅读全文
posted @ 2015-06-23 20:54 __Meng 阅读(487) 评论(0) 推荐(0) 编辑
摘要: 判断所给的图是不是生成树,如果有环就不是,如果没环但连通分量大于1也不是find函数 用递归写的话 会无限栈溢出 Orz要加上那一串 手动扩栈Sample Input6 8 5 3 5 2 6 45 6 0 08 1 7 3 6 2 8 9 7 57 4 7 8 7 6 0 0... 阅读全文
posted @ 2015-06-23 12:43 __Meng 阅读(261) 评论(0) 推荐(0) 编辑
摘要: 求一个图 变成生成树至少还要加几条边(成环的边要删掉,但不用统计)Sample Input4 2 //n m1 3//u v4 33 31 21 32 35 21 23 5999 00 Sample Output102998 1 # include 2 # include 3 # include... 阅读全文
posted @ 2015-06-22 23:25 __Meng 阅读(215) 评论(0) 推荐(0) 编辑
上一页 1 ··· 51 52 53 54 55 56 57 58 59 ··· 64 下一页