洛谷—— P3469 [POI2008]BLO-Blockade 题目描述 There are exactly towns in Byteotia. Some towns are connected by bidirectional roads. There are no crossroads ou ...
分类:
其他好文 时间:
2017-06-24 11:19:10
阅读次数:
207
Rebuilding Roads Description The cows have reconstructed Farmer John's farm, with its N barns (1 <= N <= 150, number 1..N) after the terrible earthqua ...
分类:
其他好文 时间:
2017-06-21 09:41:22
阅读次数:
141
There are n cities and m two-way roads in Berland, each road connects two cities. It is known that there is no more than one road connecting each pair ...
分类:
其他好文 时间:
2017-06-13 19:51:14
阅读次数:
218
Constructing Roads Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 13518 Accepted Submission(s): ...
分类:
其他好文 时间:
2017-06-10 15:38:06
阅读次数:
168
算法: dp[i][j]表示以i为根的子树要变成有j个节点的状态需要减掉的边数。 考虑状态转移的时候不考虑i的父亲节点,就当不存在。最后统计最少减去边数的 时候+1。 考虑一个节点时,有两种选择,要么剪掉跟子节点相连的边,则dp[i][j] = dp[i][j]+1; 要么不剪掉,则d[i][j] ...
分类:
其他好文 时间:
2017-06-07 15:41:37
阅读次数:
119
There are N villages, which are numbered from 1 to N, and you should build some roads such that every two villages can connect to each other. We say t ...
分类:
其他好文 时间:
2017-06-05 22:19:03
阅读次数:
194
今天开始做老师给的专辑,打开DP专辑 A题 Rebuilding Roads 直接不会了,发现是树形DP,百度了下了该题,看了老半天看不懂,想死的冲动都有了~~~~ 最后百度了下,树形DP入门,找到了 poj 2342 Anniversary party 先入门一下~ 题意: 某公司要举办一次晚会, ...
分类:
其他好文 时间:
2017-05-26 18:58:15
阅读次数:
250
因为上次比赛sb地把一道树形dp当费用流做了,受了点刺激,用一天时间稍微搞一下树形DP,今后再好好搞一下) 基于背包原理的树形DP poj 1947 Rebuilding Roads 题意:给你一棵树,让你求最少剪掉多少条边可以剪出一棵点数为m的子树. 解法:dp[i][j]表示i节点得到j个节点的 ...
分类:
其他好文 时间:
2017-05-26 18:56:32
阅读次数:
274
The kingdom of Olympia consists of N cities and M bidirectional roads. Each road connects exactly two cities and two cities can be connected with more ...
分类:
其他好文 时间:
2017-05-26 00:42:36
阅读次数:
283
Rebuilding Roads Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 9957 Accepted: 4537 Description The cows have reconstructed Farmer John's ...
分类:
其他好文 时间:
2017-05-21 16:02:14
阅读次数:
168