![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
贪心
文章平均质量分 84
Lionel_D
这个作者很懒,什么都没留下…
展开
-
poj 2054 Color a Tree 据说是贪心
Bob is very interested in the data structure of a tree. A tree is a directed graph in which a special node is singled out, called the "root" of the tree, and there is a unique path from the root to each of the other nodes. Bob intends to color all the no原创 2015-02-06 19:13:01 · 1812 阅读 · 0 评论 -
hdu 2570 迷瘴 低级贪心
通过悬崖的yifenfei,又面临着幽谷的考验——幽谷周围瘴气弥漫,静的可怕,隐约可见地上堆满了骷髅。由于此处长年不见天日,导致空气中布满了毒素,一旦吸入体内,便会全身溃烂而死。幸好yifenfei早有防备,提前备好了解药材料(各种浓度的万能药水)。现在只需按照配置成不同比例的浓度。现已知yifenfei随身携带有n种浓度的万能药水,体积V都相同,浓度则分别为Pi%。并且知道,针对当时幽谷的瘴气情况,只需选择部分或者全部的万能药水,然后配置出浓度不大于 W%的药水即可解毒。现在的问题是:如何配置此药原创 2015-02-07 15:06:36 · 821 阅读 · 0 评论 -
hdu 1231 最大连续子序列 DP
给定K个整数的序列{ N1, N2, ..., NK },其任意连续子序列可表示为{ Ni, Ni+1, ..., Nj },其中 1 <= i <= j <= K。最大连续子序列是所有连续子序列中元素和最大的一个, 例如给定序列{ -2, 11, -4, 13, -5, -2 },其最大连续子序列为{ 11, -4, 13 },最大和 为20。原创 2015-02-08 14:33:44 · 1053 阅读 · 0 评论 -
hdu 1069 Monkey and Banana 再来一波DP啦~~LIS的变形,会最大上升子序列就可以A啦~
A group of researchers are designing an experiment to test the IQ of a monkey. They will hang a banana at the roof of a building, and at the mean time, provide the monkey with some blocks. If the monkey is clever enough, it shall be able to reach the banan原创 2015-02-09 20:49:41 · 1552 阅读 · 0 评论 -
hdu 4296 Buildings 贪心算法 今日首A 详细解析 ,有些数据类型最好用long long
Problem Description Have you ever heard the story of Blue.Mary, the great civil engineer? Unlike Mr. Wolowitz, Dr. Blue.Mary has accomplished many great projects, one of which is the Guanghua Building. The public opinion is that Guanghua Building is no原创 2015-03-05 20:09:16 · 1253 阅读 · 0 评论 -
hdu 1052 Tian Ji -- The Horse Racing 可恶的贪心-------也算是经典贪心题吧,对于一般人来说,不看题解,应该很难做出来吧
Problem DescriptionHere 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 of Tian and the king have three horses in原创 2015-03-04 15:19:09 · 1038 阅读 · 0 评论 -
hdu 3661 Assignments 贪心
Problem DescriptionIn a factory, there are N workers to finish two types of tasks (A and B). Each type has N tasks. Each task of type A needs xi time to finish, and each task of type B needs yj time to finish, now, you, as the boss of the factory, need to原创 2015-03-08 17:11:32 · 865 阅读 · 0 评论