![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
贪心策略
RPG_Zero
春日雨,夏蝉鸣,明天是个好天气。
秋风起,雪花轻,海底看不见四季。
展开
-
POJ 2376 Cleaning Shifts 区间贪心 结构体中运算符重载
DescriptionFarmer John is assigning some of his N (1 <= N <= 25,000) cows to do some cleaning chores around the barn. He always wants to have one cow working on cleaning things up and has divi...原创 2019-08-05 13:41:31 · 128 阅读 · 0 评论 -
HDOJ 2124 Repair the wall 九度教程第24题 贪心 水~
题目链接解题思路:贪心,每次选择当前最长的木板即可。AC代码://贪心 每次选择最长的木板#include<iostream>#include<stdio.h>#include<queue>#include<vector>#include<functional>using namespace std;priorit...原创 2019-09-06 21:14:24 · 184 阅读 · 0 评论 -
HDOJ 迷瘴 贪心策略
题目链接解题思路:贪心策略,每次都选择当前剩余药水中浓度最小的那一瓶,这样的话对于整体浓度的提升最小。AC代码://贪心 每次选择浓度最低的解药#include<iostream>#include<stdio.h>#include<queue>#include<vector>#include<functional>us...原创 2019-09-06 20:53:29 · 170 阅读 · 0 评论 -
HDOJ 2037 区间贪心 + 优先队列
题目链接解题思路:区间贪心,贪心策略为每次选择结束时间最早的区间,同时使用了优先队列来按照结束时间的前后保存各个区间。AC代码:#include<iostream>#include<stdio.h>#include<queue>#include<vector>#include<functional>using names...原创 2019-09-06 20:20:20 · 245 阅读 · 0 评论 -
POJ 1065 Wooden Sticks 贪心+动态规划之单调递增子序列
DescriptionThere is a pile of n wooden sticks. The length and weight of each stick are known in advance. The sticks are to be processed by a woodworking machine in one by one fashion. It needs some ...原创 2019-08-17 22:30:30 · 170 阅读 · 0 评论 -
poj_3617 Best Cow Line(贪心)
题目链接DescriptionFJ is about to take his N (1 ≤ N ≤ 2,000) cows to the annual"Farmer of the Year" competition. In this contest every farmer arranges his cows in a line and herds them past the judges....原创 2019-07-12 14:53:19 · 127 阅读 · 0 评论 -
POJ 3262 Protecting the Flowers 贪心比率
DescriptionFarmer John went to cut some wood and left N (2 ≤ N ≤ 100,000) cows eating the grass, as usual. When he returned, he found to his horror that the cluster of cows was in his garden eating ...原创 2019-08-12 15:36:53 · 150 阅读 · 0 评论 -
POJ 1862 Stripies 贪心
DescriptionOur chemical biologists have invented a new very useful form of life called stripies (in fact, they were first called in Russian - polosatiki, but the scientists had to invent an English ...原创 2019-08-12 10:10:18 · 151 阅读 · 0 评论 -
POJ 3614 Sunscreen(贪心 优先队列)有助于理解贪心过程
题目链接DescriptionTo 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 ...原创 2019-08-20 19:12:16 · 505 阅读 · 2 评论 -
POJ 3040 Allowance 贪心
DescriptionAs a reward for record milk production, Farmer John has decided to start paying Bessie the cow a small weekly allowance. FJ has a set of coins in N (1 <= N <= 20) different denomina...原创 2019-08-11 15:25:15 · 160 阅读 · 0 评论 -
POJ 1017 Packets 贪心
DescriptionA factory produces products packed in square packets of the same height h and of the sizes 11, 22, 33, 44, 55, 66. These products are always delivered to customers in the square parcels o...原创 2019-08-10 20:16:28 · 167 阅读 · 0 评论 -
POJ 1328 Radar Installation 区间贪心
DescriptionAssume the coasting is an infinite straight line. Land is in one side of coasting, sea in the other. Each small island is a point locating in the sea side. And any radar installation, loc...原创 2019-08-07 09:19:41 · 152 阅读 · 0 评论 -
POJ 2393 Yogurt factory 贪心
DescriptionThe cows have purchased a yogurt factory that makes world-famous Yucky Yogurt. Over the next N (1 <= N <= 10,000) weeks, the price of milk and labor will fluctuate weekly such that ...原创 2019-08-08 17:39:21 · 162 阅读 · 0 评论 -
POJ 3190 Stall Reservations 贪心+优先队列
DescriptionOh those picky N (1 <= N <= 50,000) cows! They are so picky that each one will only be milked over some precise time interval A…B (1 <= A <= B <= 1,000,000), which includes...原创 2019-08-08 09:18:40 · 127 阅读 · 0 评论 -
POJ 3069 Saruman's Army(贪心) 解题报告
DescriptionSaruman 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 troo...原创 2019-08-05 13:34:27 · 2520 阅读 · 0 评论 -
To Fill or Not to Fill 九度教程第25题 较为复杂的贪心策略
题目链接With highways available, driving a car from Hangzhou to any other city is easy. But since the tank capacity of a car is limited, we have to find gas stations on the way from time to time. Differ...原创 2019-09-07 15:40:56 · 650 阅读 · 0 评论