
贪心
文章平均质量分 74
「已注销」
复杂网络
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
第三篇 贪心思想
说到“贪”字,很邪恶的一个词,记得和珅和大人拆解过这个字,为”今“和”贝“,而”贝“字分解成”上面的那个XX“和”人“,意思就是说今天你贪了,明天一座监狱就把你套起来,纵观古今,有多少豪杰与"贪“结下了不解之缘,呵呵,扯远了。 这个贪心的行为在算法中也成为了一种指导思想,也就是说贪心算法所作出的选择在当时的环境下是最好的,说深一点就是它只是某种意义上的局部最优解,但不一定是全原创 2015-01-05 13:00:04 · 541 阅读 · 0 评论 -
A. Amr and Music
A. Amr and Musictime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputAmr is a young coder who likes music a lot. He always原创 2015-01-24 16:07:13 · 749 阅读 · 0 评论 -
贪心、递归、递推以及动态规划算法的分析与对比(转:By: 夏天の冰块的BLOG)
贪心、递归、递推以及动态规划算法的分析与对比王喆 天津市第五十五中学【关键字】动态规划 贪心 递归 递推 分析 说明 NOIP【摘要】本文通过典型例题分析出贪心算法、递归算法、递推算法以及动态规划算法的区别和相似处。以及对这几种算法的思考方法,编程方法以及“递归节省时间浪费空间,递推滚动节省空间浪费时间”的解释和举例论证。【正文】一、各算法的介绍1.1贪心算法贪原创 2015-01-04 14:32:30 · 986 阅读 · 0 评论 -
Hdu-4864-Task
#include #include #include #include #include #include using namespace std;#define N 100010struct LNode{ int x,y;}f1[N],f2[N];bool cmp(LNode a,LNode b){ //这里排序也容易出错! //return a.y > b.y;原创 2014-07-23 09:40:04 · 921 阅读 · 0 评论 -
Uva---11520Problem A Fill the Square (贪心+模拟)
Problem AFill the SquareInput: Standard InputOutput: Standard Output In this problem, you have to draw a square using uppercase English Alphabets.To be more precise, you will be given a square原创 2015-01-04 14:32:12 · 636 阅读 · 0 评论 -
hdu---1722 Cake
CakeTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2313 Accepted Submission(s): 1203Problem Description一次生日Party可能有p人或者q人参加,现准原创 2015-01-22 15:58:28 · 606 阅读 · 0 评论 -
bjfuOJ 1097 图标排列(巧妙的贪心)
图标排列时间限制(普通/Java):1000MS/3000MS 运行内存限制:65536KByte总提交:42 测试通过:12描述百度应用平台上有很多有趣的应用,每个应用都由一个开发者开发,每个开发者可能开发一个或多个应用。百度的工程师们想把应用尽可能好的推荐给用户。研究发现,同一个开发者开发的程序的图标有很大的相似性。如果把原创 2015-01-23 10:41:56 · 687 阅读 · 0 评论 -
Little Zu Chongzhi's Triangles
贪心 + 数学模板题。。。知三角形三边,求面积方式: 三角形三边长分别为: a、b、c; 设:p=(a+b+c)/2 则:三角形的面积S=sqrt(p(p-a)(p-b)(p-c)); 一点贪心思想:将边长从大到小进行排序,从最长的三边开始选, 如果相邻三边可以围成三角形,则其比为结果三角形中的一个; 如果围不成,舍弃最长边,再向下寻找相邻三条边。A原创 2014-12-25 19:39:01 · 600 阅读 · 0 评论 -
Uva---11292Problem C: The Dragon of Loowater (贪心)
Problem C: The Dragon of LoowaterOnce upon a time, in the Kingdom of Loowater, a minor nuisance turned into a major problem.The shores of Rellau Creek in central Loowater had always been a prime b原创 2015-01-04 14:32:04 · 541 阅读 · 0 评论 -
Uva---11729Commando War(贪心)
GCommando WarInput: Standard InputOutput: Standard Output “Waiting for orders we held in the wood, word from the front never cameBy evening the sou原创 2015-01-04 14:32:07 · 507 阅读 · 0 评论 -
B. Amr and Pins
B. Amr and Pinstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputAmr loves Geometry. One day he came up with a ve原创 2015-01-24 16:11:16 · 642 阅读 · 0 评论