Tree //2010 ACM-ICPC Multi-University Training Contest(10)——Host by HEU
来源:互联网 发布:淘宝开店经验心得分享 编辑:程序博客网 时间:2024/05/09 05:16
Tree
Time Limit : 2000/1000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other)
Total Submission(s) : 17 Accepted Submission(s) : 5
Font: Times New Roman | Verdana | Georgia
Font Size: ← →
Problem Description
In the Data structure class of HEU, the teacher asks one problem: How to find the longest path of one tree and the number of such longest path?
Input
There are several test cases. The first line of each case contains only one integer N, means there are N nodes in the tree. N-1 lines follow, each line has three integers w,v and len, indicate that there is one edge between node w and v., and the length of the edge is len.
Output
For each test case, output the length of longest path and its number in one line.
Sample Input
41 2 1002 3 502 4 5041 2 1002 3 503 4 50
Sample Output
150 2200 1
Source
2010 ACM-ICPC Multi-University Training Contest(10)——Host by HEU
无奈,自己的代码没保存、、、、、、
- Tree //2010 ACM-ICPC Multi-University Training Contest(10)——Host by HEU
- SPY //2010 ACM-ICPC Multi-University Training Contest(10)——Host by HEU
- Subsequence //2010 ACM-ICPC Multi-University Training Contest(10)——Host by HEU
- Max Angle //2010 ACM-ICPC Multi-University Training Contest(10)——Host by HEU
- Computer Assembling //2010 ACM-ICPC Multi-University Training Contest(10)——Host by HEU
- 2010 ACM-ICPC Multi-University Training Contest(14)——Host by BJTU
- 2010 ACM-ICPC Multi-University Training Contest(11)——Host by BUPT
- 2010 ACM-ICPC Multi-University Training Contest(2)——Host by BUPT
- hdu 3496 Watch The Movie //2010 ACM-ICPC Multi-University Training Contest(6)——Host by BIT
- hdu 3491 Thieves //2010 ACM-ICPC Multi-University Training Contest(6)——Host by BIT
- HDU 3488 Tour //2010 ACM-ICPC Multi-University Training Contest(6)——Host by BIT
- HDU 3602 2012(2010 ACM-ICPC Multi-University Training Contest(16)——Host by NUDT)
- HDU3523 Image copy detection 最小权匹配KM 2010 ACM-ICPC Multi-University Training Contest(9)——Host by HNU
- HDU 3605 Escape 最大流or二分图多重匹配 2010 ACM-ICPC Multi-University Training Contest(17)——Host by ZSTU
- 2010 ACM-ICPC Multi-University Training Contest(1) ——A Task Process
- hdu3555 - Bomb(2010 ACM-ICPC Multi-University Training Contest(12))数位dp
- HDU 3015——Disharmony Trees(树状数组 2009 Multi-University Training Contest 12 - Host by FZU)
- hdu 3094 A tree game 2009 Multi-University Training Contest 18 - Host by ECNU
- HDU3127 二维完全背包 DP
- Socket服务端接受多个客户端的连接(.NET)
- Ubuntu中国的源,包括教育网
- SRM 480 DIV 2
- 伪指令LDR和ADR的分析
- Tree //2010 ACM-ICPC Multi-University Training Contest(10)——Host by HEU
- Symbian SilentSms拦截短信的经验分享
- 观察者模式剖析
- IEEE和SCI等的通俗简介
- arm指令中mov和ldr有什么区别
- Subsequence //2010 ACM-ICPC Multi-University Training Contest(10)——Host by HEU
- 看完后你会明白很多事 (转)
- ADF应用程序中创建和恢复保存点
- Max Angle //2010 ACM-ICPC Multi-University Training Contest(10)——Host by HEU