题目描写叙述: The Head Elder of the tropical island of Lagrishan has a problem. A burst of foreign aid money was spent on extra roads between villages some ...
分类:
其他好文 时间:
2017-07-01 17:20:44
阅读次数:
253
题目描述 Farmer John had just acquired several new farms! He wants to connect the farms with roads so that he can travel from any farm to any other farm v ...
分类:
其他好文 时间:
2017-06-26 21:07:06
阅读次数:
130
题目描述 Farmer John is constructing a new milking machine and wishes to keep it secret as long as possible. He has hidden in it deep within his farm and ...
分类:
系统相关 时间:
2017-06-24 11:27:32
阅读次数:
304
洛谷—— 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