![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
贪心只能过样例
UncleJokerly
Tough days don't last.Tough people do.
展开
-
HDU1231最大连续子序列&Uva108Maximum Sum最大子矩阵(尺取法)
HDU1231:给定K个整数的序列{ N1, N2, …, NK },其任意连续子序列可表示为{ Ni, Ni+1, …, Nj },其中 1 <= i <= j <= K。最大连续子序列是所有连续子序列中元素和最大的一个, 例如给定序列{ -2, 11, -4, 13, -5, -2 },其最大连续子序列为{ 11, -4, 13 },最大和 为20。 在今...原创 2017-07-11 13:12:10 · 512 阅读 · 0 评论 -
HDU1009 FatMouse' Trade(贪心)
FatMouse prepared M pounds of cat food, ready to trade with the cats guarding the warehouse containing his favorite food, JavaBean. The warehouse has N rooms. The i-th room contains Jii pounds of Ja...原创 2017-07-10 10:55:33 · 693 阅读 · 0 评论 -
POJ 1328 Radar Installation (贪心)
Assume 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, locating on the原创 2018-01-25 17:05:56 · 221 阅读 · 0 评论 -
HihoCoder - 1672 区间问题(贪心)
给定N个区间[Ai, Bi],请你找到包含元素最少的整数集合S,使得每个区间都至少有两个整数在S中。 例如给定三个区间[1, 3], [1, 4], [2, 5],则S={2, 3}。Input第一行包含一个整数N。以下N行每行包含两个整数Ai, Bi。 对于30%的数据,1 ≤ N ≤ 1000 对于100%的数据, 1 ≤ N ≤ 100000 1 ≤ Ai &l...原创 2018-11-18 20:02:00 · 398 阅读 · 0 评论 -
HDU1051 Wooden Sticks(贪心&结构体排序)
There 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 time, called ...原创 2018-11-16 11:39:07 · 216 阅读 · 0 评论 -
HDU5246 超级赛亚ACMer(贪心)
百小度是一个ACMer,也是一个超级赛亚人,每个ACMer都有一个战斗力,包括百小度。&#8232;所谓超级赛亚人的定义,是说如果在对抗中刚好接近极限状态,那就会激发斗志,实力提升. 具体来说,就是百小度现在要接受一些ACMer的挑战了,这些ACMer有n个人,第i个人的战斗力是a[i]。 &#8232;百小度接下来可以自主安排与这n个ACMer的PK顺序,他要想在PK赛中赢过...原创 2018-11-19 13:34:12 · 244 阅读 · 1 评论 -
2013年第四届蓝桥杯C/C++程序设计本科B组省赛 翻硬币(贪心)
题目标题:翻硬币 小明正在玩一个“翻硬币”的游戏。 桌上放着排成一排的若干硬币。我们用 * 表示正面,用 o 表示反面(是小写字母,不是零)。 比如,可能情形是:**oo***oooo 如果同时翻转左边的两个硬币,则变为:oooo***oooo 现在小明的问题是:如果已知了初始状态和要达到的目标状态,每次只能同时翻转相邻的两个硬币,那么对...原创 2019-03-19 20:06:44 · 226 阅读 · 0 评论