Sunscreen POJ - 3614(防曬油) 貪心-優先佇列
To avoid unsightly burns while tanning, each of the C (1 ≤ C ≤ 2500) cows must cover her hide with sunscreen when they’re at the beach. Cow i has a minimum and maximum SPF rating (1 ≤ minSPFi ≤ 1,000; minSPFi ≤maxSPFi ≤ 1,000) that will work. If the SPF rating is too low, the cow
suffers sunburn; if the SPF rating is too high, the cow doesn’t tan at all…The cows have a picnic basket with L (1 ≤ L ≤ 2500) bottles of sunscreen lotion, each bottle i with an SPF rating SPFi (1 ≤ SPFi ≤ 1,000). Lotion bottle i can cover coveri cows with lotion. A cow may lotion from only one bottle.
What is the maximum number of cows that can protect themselves while tanning given the available lotions?
Input
- Line 1: Two space-separated integers: C and L
- Lines 2…C+1: Line i describes cow i’s lotion requires with two integers: minSPFi and maxSPFi
- Lines C+2…C+L+1: Line i+C+1 describes a sunscreen lotion bottle i with space-separated integers: SPFi and coveri
Output
A single line with an integer that is the maximum number of cows that
can be protected while tanning
Sample Input
3 2
3 10
2 5
1 5
6 2
4 1
Sample Output
2
相關文章
- 8.13(優先佇列貪心維護+打表找規律+對頂堆優先佇列+DFS減枝+貪心dp)佇列
- HDU5630 Hiking(貪心+優先佇列)佇列
- CodeForces - 960B:Minimize the error(優先佇列+貪心)Error佇列
- uva10954Add All(貪心+優先佇列)佇列
- POJ 3253 Fence Repair 優先佇列AI佇列
- [USACO 2009 Feb Gold] Fair Shuttle (貪心+優先佇列)GoAI佇列
- POJ 1724 ROADS(優先佇列+spfa)佇列
- POJ2431 Expedition (優先佇列)佇列
- POJ 2051(最小堆/優先佇列)佇列
- POJ 3253Fence Repair(哈夫曼&優先佇列)AI佇列
- BZOJ 1572 [Usaco2009 Open]工作安排Job:貪心 + 優先佇列【先放再更新】佇列
- hdu5380 貪心+雙端佇列佇列
- Codeforces Round #390 (Div. 2)(A,B,C(記憶化搜尋),D(貪心,優先佇列))佇列
- PHP優先佇列PHP佇列
- 堆--優先佇列佇列
- 優先佇列 (轉)佇列
- BZOJ 1724 [Usaco2006 Nov]Fence Repair 切割木板:貪心 優先佇列【合併果子】AI佇列
- 淺談優先佇列佇列
- STL 優先佇列 用法佇列
- 堆與優先佇列佇列
- 堆和優先佇列佇列
- 優先佇列的學習記錄--例題:Expedition(POJ2431)佇列
- POJ 3253-Fence Repair(哈夫曼樹-最小值優先佇列)AI佇列
- 優先佇列和堆排序佇列排序
- 堆排序與優先佇列排序佇列
- Java優先佇列(PriorityQueue)示例Java佇列
- BZOJ1029: [JSOI2007]建築搶修[模擬 貪心 優先佇列]JS佇列
- 01揹包優先佇列優化佇列優化
- 棧,佇列,優先順序佇列簡單介面使用佇列
- Redis實現任務佇列、優先順序佇列Redis佇列
- NO GAME NO LIFE(優先佇列/最小堆)GAM佇列
- 優先佇列的比較器佇列
- 封裝優先順序佇列封裝佇列
- 二叉堆優先佇列佇列
- 堆——神奇的優先佇列(上)佇列
- 優先佇列的效能測試佇列
- hdu5040 優先佇列+bfs佇列
- POJ 1442-Black Box(動態區間第K小-優先佇列)佇列