![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
贪心
文章平均质量分 93
少年织梦
一直在路上
展开
-
HDU 1052 田忌赛马(贪心)
Here is a famous story in Chinese history."That was about 2300 years ago. General Tian Ji was a high official in the country Qi. He likes to play horse racing with the king and others.""Both o原创 2017-05-23 10:20:55 · 358 阅读 · 0 评论 -
POJ1017-Packets
大致题意: 一个工厂制造的产品形状都是长方体盒子,它们的高度都是 h,长和宽都相等,一共有六个型号,分别为1*1, 2*2, 3*3, 4*4, 5*5, 6*6。 这些产品通常使用一个 6*6*h 的长方体箱子包装然后邮寄给客户。因为邮费很贵,所以工厂要想方设法的减小每个订单运送时的箱子数量BoxNum。解题思路: 由于盒子和箱子的高均为h,因此只需考虑底面积的空间。6*6的盒子,每个盒子独原创 2017-07-03 10:54:46 · 266 阅读 · 0 评论 -
POJ 2431 Expedition (贪心 + 优先队列)
每日一看ExpeditionTime Limit:1000MS Memory Limit:65536K Total Submissions:16212 Accepted:4618 DescriptionA group of cows grabbed a truck and ventured on an expedition deep in...原创 2017-06-20 16:13:50 · 454 阅读 · 0 评论 -
POJ1328解题报告 (贪心)
Radar Installation Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 87836 Accepted: 19690 DescriptionAssume the coasting is an infinite straight line. Land is in one side of co原创 2017-06-29 17:17:25 · 846 阅读 · 0 评论 -
POJ 2376 Cleaning Shifts 贪心
Cleaning Shifts Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 21929 Accepted: 5472 DescriptionFarmer John is assigning some of his N (1 <= N <= 25,000) cows to do some clean原创 2017-06-29 14:24:29 · 295 阅读 · 0 评论 -
poj3069 Saruman's Army 贪心
Saruman's ArmyTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 10178Accepted: 5122DescriptionSaruman the White must lead his army along a straight pat原创 2017-06-19 23:00:46 · 278 阅读 · 0 评论 -
POJ-3617-Best Cow Line(贪心算法+Java)
Best Cow LineTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 11700Accepted: 3430DescriptionFJ is about to take his N (1 ≤ N ≤ 2,000) cows to the原创 2017-06-19 21:35:54 · 376 阅读 · 0 评论 -
HDU 1051 Wooden Sticks
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 5883 Accepted Submission(s): 2438Problem Description There is a pile of n wooden sticks. Th原创 2017-05-21 21:12:11 · 189 阅读 · 0 评论 -
hdu1050 Moving Tables
思路:假设从1->399(或者2->400)的走廊是一条线段,每搬一张桌子(如从30号房间搬到40号房间),则线段30->40被重复了一次。如果另外再搬一张桌子(如从35号房间搬到45号房间),则线段35->45被重复了一次。而相同的线段35->40则被重复了两次。问题转化为求最大重复次数。那很好办了,一个201大小的数组表示走廊位置,初始化为0. 若30->40重复(30号房间搬桌子到40号房间)原创 2017-05-21 20:41:59 · 243 阅读 · 0 评论 -
POJ1328解题报告
每日一看Radar InstallationTime Limit:1000MS Memory Limit:10000K Total Submissions:40799 Accepted:9034 DescriptionAssume the coasting is an infinite straight line. Land is ...原创 2017-06-05 16:23:30 · 5921 阅读 · 1 评论 -
hdu 1009 FatMouse' Trade
FatMouse' TradeTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 77049 Accepted Submission(s): 26462Problem DescriptionFatMouse原创 2017-05-17 09:06:06 · 300 阅读 · 0 评论 -
POJ 1862 Stripies 题解
变形虫:从N个数任取两个数按2*sqrt(a*b)合成新数放回,求最后那个数的最小值。 贪心策略是使尽量使大的数多参与开放运算。每次取出最大和次大的变形虫杂交,直至剩下一条光棍。使用最大堆可以很高效地维持最大的数。#include <iostream>#include <queue>#include <cmath>using namespace std;///////////////////原创 2017-07-03 14:34:40 · 264 阅读 · 0 评论