文件名称:1
-
所属分类:
- 标签属性:
- 上传时间:2015-11-17
-
文件大小:1.03kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
给定一颗有权无根树,修改任意一条边,求最少的任意两点间的距离和:修改一条边是指删除树中的一条边,然后选择两个端点连线,形成一课新的树,并且不改变这条边的权值,在这棵树的基础上,求最少的任意两点间的距离和是多少
任意两点的距离和指:sum(a到b的距离,a<b,a和b都是树上的点)
输入:第一行是整数n,接下来n-1行,每行包括3个整数ai,bi,wi,表示节点ai与bi之间有一条权重为wi的边。
输出:最小的任意两点间的距离和
-Given a right to unrooted tree, modify any one side (you can not modify), the number of required minimum distance between any two points and is? Modify an edge means an edge to delete the tree, then the two endpoints of the connection, the formation of a new class of trees, and does not change the weight of this edge, in this tree, based on the minimum requirements of any two the distance between the points and how much distance between any two points and means: sum (a b distance, a <b,a和b都是树上的点)
输入:第一行是整数n,接下来n-1行,每行包括3个整数ai,bi,wi,表示节点ai与bi之间有一条权重为wi的边。
输出:最小的任意两点间的距离和
任意两点的距离和指:sum(a到b的距离,a<b,a和b都是树上的点)
输入:第一行是整数n,接下来n-1行,每行包括3个整数ai,bi,wi,表示节点ai与bi之间有一条权重为wi的边。
输出:最小的任意两点间的距离和
-Given a right to unrooted tree, modify any one side (you can not modify), the number of required minimum distance between any two points and is? Modify an edge means an edge to delete the tree, then the two endpoints of the connection, the formation of a new class of trees, and does not change the weight of this edge, in this tree, based on the minimum requirements of any two the distance between the points and how much distance between any two points and means: sum (a b distance, a <b,a和b都是树上的点)
输入:第一行是整数n,接下来n-1行,每行包括3个整数ai,bi,wi,表示节点ai与bi之间有一条权重为wi的边。
输出:最小的任意两点间的距离和
(系统自动生成,下载前可以参看下载内容)
下载文件列表
1.txt
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.