
树--LCA
至此曾经
从未坚持?
展开
-
codeforces 832D Misha, Grisha and Underground
Input The first line contains two integers n and q (2 ≤ n ≤ 105, 1 ≤ q ≤ 105) — the number of stations and the number of days. The second line contains n - 1 integers p2, p3, ..., pn (1 ≤ pi ≤ n).原创 2017-07-25 10:19:38 · 1196 阅读 · 0 评论 -
hdu 6201 transaction transaction transaction
Problem Description Kelukin is a businessman. Every day, he travels around cities to do some business. On August 17th, in memory of a great man, citizens will read a book named "the Man Who Changed C原创 2017-09-10 22:19:30 · 254 阅读 · 0 评论 -
“浪潮杯”第九届山东省ACM大学生程序设计竞赛 D-Dance
链接:https://www.nowcoder.com/acm/contest/123/D来源:牛客网题意:在根节点为0的树上(编号:0,1,2...n)。一条边上有两个值 poweri ,numi,相当于网络流:poweri相当于路上的cost,numi相当于容量,相当于汇点为0,源点为所有叶子节点,求最大费用。样例:70 100 01 2 32 2 51 5 12 1 33 2 44 3 2输...原创 2018-05-31 14:46:10 · 535 阅读 · 0 评论