![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
贪心
文章平均质量分 82
ahonn
www.ahonn.me
展开
-
Poj 3544 Journey with Pigs
/* Poj 3544 Journey with Pigs 将n头猪卖给n个村庄,猪重wi,每个村庄到起点的距离是dj,每斤猪肉在第j个村庄的单价是pj,每斤猪肉运输一个单位长度花费t元,为保证赚到最多的钱,该怎样分配? 输入n,t。接着输入,第一行为n个数表示猪的重量,第二行为n个数表示到村庄的距离,第三行为n个数表示每个村庄的猪肉价格。 输出n个数,第j个数表示出售到第j个村庄的猪的编号,每只原创 2015-06-09 10:30:03 · 311 阅读 · 0 评论 -
POJ 3069 Saruman's Army
Description Saruman the White must lead his army along a straight path from Isengard to Helm’s Deep. To keep track of his forces, Saruman distributes seeing stones, known as palantirs, among the原创 2015-06-10 11:20:12 · 361 阅读 · 0 评论 -
UVa10037 Bridge
n people wish to cross a bridge at night. A group of at most two people may cross at any time, and each group must have a flashlight. Only one flashlight is available among the n people, so some sor原创 2015-07-19 15:37:50 · 432 阅读 · 0 评论