NOI 4.6 贪心 2384: Cell Phone Network(树形DP)

题目来源:http://noi.openjudge.cn/ch0406/2384/

2384: Cell Phone Network

总时间限制10000ms    单个测试点时间限制1000ms     内存限制65536kB

描述

Farmer John has decided to give each of his cows a cell phone inhopes to encourage their social interaction. This, however, requires him to setup cell phone towers on his N (1 <= N <= 10,000) pastures (convenientlynumbered 1..N) so they can all communicate.

Exactly N-1 pairs of pastures are adjacent, and for any two pastures A and B (1<= A <= N; 1 <= B <= N; A != B) there is a sequence of adjacentpastures such that A is the first pasture in the sequence and B is the last.Farmer John can only place cell phone towers in the pastures, and each towerhas enough range to provide service to the pasture it is on and all pasturesadjacent to the pasture with the cell tower.

Help him determine the minimum number of towers he must install to provide cellphone service to each pasture.

输入

* Line 1: A single integer: N

* Line

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值