POJ2392:Space Elevator】的更多相关文章

Space Elevator Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 9244   Accepted: 4388 Description The cows are going to space! They plan to achieve orbit by building a sort of space elevator: a giant tower of blocks. They have K (1 <= K <…
Space Elevator   Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 8569   Accepted: 4052 Description The cows are going to space! They plan to achieve orbit by building a sort of space elevator: a giant tower of blocks. They have K (1 <= K…
Description The cows are going to space! They plan to achieve orbit by building a sort of space elevator: a giant tower of blocks. They have K (1 <= K <= 400) different types of blocks with which to build the tower. Each block of type i has height h…
A - Space Elevator Time Limit:1000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u Submit Status Description The cows are going to space! They plan to achieve orbit by building a sort of space elevator: a giant tower of blocks. They have…
POJ 2392 Space Elevator(贪心+多重背包) http://poj.org/problem?id=2392 题意: 题意:给定n种积木.每种积木都有一个高度h[i],一个数量num[i].另一个限制条件,这个积木所在的位置不能高于limit[i],问能叠起的最大高度? 分析: 本题是一道多重背包问题, 只是每一个物品的选择不只要受该种物品的数量num[i]限制, 且该物品还受到limit[i]的限制. 这里有一个贪心的结论: 我们每次背包选取物品时都应该优先放置当前limit…
Description The cows are going to space! They plan to achieve orbit by building a sort of space elevator: a giant tower of blocks. They have K ( <= K <= ) different types of blocks with which to build the tower. Each block of type i has height h_i (…
题目 1739: [Usaco2005 mar]Space Elevator 太空电梯 Time Limit: 5 Sec  Memory Limit: 64 MB Description The cows are going to space! They plan to achieve orbit by building a sort of space elevator: a giant tower of blocks. They have K (1 <= K <= 400) differe…
Q: 额外添加了最大高度限制, 需要根据 alt 对数据进行预处理么? A: 是的, 需要根据 alt 对数组排序 Description The cows are going to space! They plan to achieve orbit by building a sort of space elevator: a giant tower of blocks. They have K (1 <= K <= 400) different types of blocks with w…
http://poj.org/problem?id=2392 题意: 有一群牛要上太空.他们计划建一个太空梯-----用一些石头垒.他们有K种不同类型的石头,每一种石头的高度为h_i,数量为c_i,并且由于会受到太空辐射,每一种石头不能超过这种石头的最大建造高度a_i.帮助这群牛建造一个最高的太空梯. 吐槽: 做练习的时候,连需不需要对数据排序都没分析清楚...下次再也不把练习安排在上午了,一般我上午状态极差(┬_┬) 这题由于数据较水,可以直接把多重背包转化为01背包求解,当然由于设定的状态不…
题目大意 n件物品,第i件hi高,有ci件,最高的一件不能超过ai的高度.问最高能堆多高 输入: 第一行,一个n 接下来每一行,为hi,ai,ci 输出,最高堆多高 样例输入: 37 40 35 23 82 52 6 样例输出: 48 (从下到上:3个2号,3个1号,6个3号) 分析: 我们很容易想到要先放限制高度小的,那我们就先按限制高度从小到大排序. 然后我们可以发现,这个和多重背包很像,“物重”“价值”都为hi,数量为ci 设dp[i][j]为用前i件,花费高度j的盒子,最高能堆多高(显然…