世界真的很大
趁着早上还没开始考试,悄咪咪地做一道树形DP
input里面没读出是多组数据,WA了两发才发现orz
主要是感觉还是不是很熟悉,特别是对于树形这一方面地问题
趁着NOIP之前赶紧地复习一下
就从这道水题开始吧
看题先:
description:
题目给出一棵树,每个节点都有其权值。如果选择了一个节点则不可以选择其父节点,问能取得的最大值
input:
Employees are numbered from 1 to N. A first line of input contains a number N. 1 <= N <= 6 000. Each of the subsequent N lines contains the conviviality rating of the corresponding employee. Conviviality rating is an integer number in a range from -128 to 127. After that go T lines that describe a supervisor relation tree. Each line of the tree spe