阅读背景:

POJ 3253 Fence Repair(优先队列+思维贪心)(哈夫曼树算法)

来源:互联网 
Farmer John wants to repair a small length of the fence around the pasture. He measures the fence and finds that he needs N (1 ≤ N ≤ 20,000) planks of wood, each having some integer length Li (1 ≤ Li ≤ 50,000) units. He then purchases a single long board just long enough to saw into the N planks (i.e., whose length is the sum of the lengths Li). FJ is ignoring the "kerf", the extra length lost to sawdust when a sawcut is made; you should ignore it, too.Farmer John wants to repair a small length of the


你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: