当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

3588:Pair

题目描述
There are n cities in country X. Some pairs of cities are connected by bidirectional roads, and there exists one and only one path between every pair of cities.
  Lily wants to take a trip in country X. She can start from any city, and she wouldn’t visit a city twice. Lily is effeminate, so the total distance of this trip should not be larger than L.
  Your task is to calculate the number of all possible trips. Two trips are distinct if and only if the set of cities they contain are different.

输入解释
  The first line contains two integers n and m, n is the number of cities, and m is the number of roads. The following m lines describe m roads, each of which contains three integers a, b, c, representing that a and b are connected by an undirected road which length is c. The last line contains a integer L.
  1<=n<=100000, 1<=c<=10000, 1<=L<=1000000000.

输出解释
For each case, output a line contains a integer.
输入样例
3 2
2 3 10
1 3 10
15
4 3
2 3 10
1 3 5
3 4 3
14
输出样例
5
9
来自杭电HDUOJ的附加信息
Author alpc50
Recommend zhouzeyong

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-3588

最后修改于 2020-10-25T23:05:01+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
6000/3000MS(Java/Others) 32768/32768K(Java/Others)