[問題] Distance In Tree
看板Prob_Solve (計算數學 Problem Solving)作者singlovesong (~"~)時間12年前 (2012/03/12 01:24)推噓4(4推 0噓 9→)留言13則, 7人參與討論串1/1
you are given a tree with n vertices and a positive number k.
Find the number of distinct pairs of the vertices which have a distance of
exactly k between them. Note that pairs (v, u) and (u, v) are considered
to be the same pair.
1<= n <= 50000
1<= k <=500
沒想法@@
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 111.81.18.160
推
03/12 01:49, , 1F
03/12 01:49, 1F
→
03/12 01:50, , 2F
03/12 01:50, 2F
→
03/12 08:25, , 3F
03/12 08:25, 3F
推
03/12 08:50, , 4F
03/12 08:50, 4F
→
03/12 08:50, , 5F
03/12 08:50, 5F
推
03/12 09:16, , 6F
03/12 09:16, 6F
→
03/12 09:16, , 7F
03/12 09:16, 7F
→
03/12 09:43, , 8F
03/12 09:43, 8F
→
03/12 09:43, , 9F
03/12 09:43, 9F
→
03/12 15:14, , 10F
03/12 15:14, 10F
推
03/12 19:28, , 11F
03/12 19:28, 11F
→
03/13 11:14, , 12F
03/13 11:14, 12F
→
03/13 11:14, , 13F
03/13 11:14, 13F
Prob_Solve 近期熱門文章
PTT數位生活區 即時熱門文章