POJ 3622 multiset】的更多相关文章

思路: 放一个链接 是我太懒了 http://blog.csdn.net/mars_ch/article/details/52835978 嗯她教的我(姑且算是吧) (一通乱搞就出来了-) //By SiriusRen #include <set> #include <cstdio> #include <cstring> #include <algorithm> using namespace std; #define N 100500 int n,m,id…
[题目链接] http://poj.org/problem?id=3622 [题目大意] 给出一些物品拥有两个属性值,价格和精美程度 给出一些需求表示要求获得的物品两个属性值的两种属性下界, 一个物品只能用一次,问满足所有需求的最小价格. [题解] 我们将物品和需求按照精美程度排序,这样我们就得到了价格的一个序列 我们降序处理物品,则可以保证对于当前需求,前面的所有物品均满足其精美程度的需求 这个时候我们只要找到满足条件的最低价格来供给这个需求,就一定是最优的, 对于最优情况的查找,我们用平衡树…
Expedition Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 18655   Accepted: 5405 Description A group of cows grabbed a truck and ventured on an expedition deep into the jungle. Being rather poor drivers, the cows unfortunately managed t…
Fence Repair Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 53106   Accepted: 17508 Description 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)…
题意: 思路: 1. 贪心 我们考虑肯定是走最近的最合适 想象自己是一个黑一日游的司机: 1.如果有乘客要上车,那么就让他上,收钱! 2.如果超载了,把距目的地最远的几个乘客踢下去,退钱. 3.行驶到下一站 (摘自http://blog.sina.com.cn/s/blog_9d987af5010158ih.html) 多么生动形象-. 用multiset乱搞就可以了(我代码写得很丑 慎看) 2 乱想的.. 我觉得可以用最大费用流+消圈来搞 (然而并不会 (也不能证明正确性) 也很可能会T )…
Constellations Time Limit: 3000MS   Memory Limit: 65536K Total Submissions: 5923   Accepted: 1164 Description The starry sky in the summer night is one of the most beautiful things on this planet. People imagine that some groups of stars in the sky f…
题目连接 http://poj.org/problem?id=1564 Sum It Up Description Given a specified total t and a list of n integers, find all distinct sums using numbers from the list that add up to t. For example, if t = 4, n = 6, and the list is [4, 3, 2, 2, 1, 1], then…
题目连接 http://poj.org/problem?id=2777 Count Color Description Chosen Problem Solving and Program design as an optional course, you are required to solve all kinds of problems. Here, we get a new problem. There is a very long board with length L centime…
题目连接 http://poj.org/problem?id=3625 Building Roads Description 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 via a sequence of roads; roads already conn…
题目连接 http://poj.org/problem?id=2560 Freckles Description In an episode of the Dick Van Dyke show, little Richie connects the freckles on his Dad's back to form a picture of the Liberty Bell. Alas, one of the freckles turns out to be a scar, so his Ri…