![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
贪心
H煊
缓一会儿。。。
展开
-
区间调度问题(贪心)
有n项工作,每项工作分别在s[i]时间开始,在t[i]时间结束。你的目标是参与尽可能多的工作(工作的时间段不能重叠),那么最多能参与多少项工作?样例:输入n=5,s={1,2,4,6,8},t={3,5,7,9,10}输出3(选取工作1,3,5)思路:贪心思想:在可选的工作中,每次都选取结束时间最早的工作;代码:const int max_n=100原创 2017-07-14 00:19:20 · 702 阅读 · 0 评论 -
ZOJ1076-Gene Assembly(贪心)
Gene AssemblyTime Limit: 2 Seconds Memory Limit: 65536 KBStatement of the ProblemWith the large amount of genomic DNA sequence data being made available, it is becoming more important原创 2017-07-13 23:20:10 · 468 阅读 · 0 评论 -
2010 ACM/ICPC 福州赛区 Problem H(贪心)
Problem 2007 Selecting coursesAccept: 68 Submit: 275Time Limit: 1000 mSec Memory Limit : 32768 KB Problem DescriptionA new Semester is coming and students are troubling for sel原创 2017-07-18 19:35:03 · 241 阅读 · 0 评论 -
POJ 1328 Radar Installation(贪心)
Radar InstallationTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 89909 Accepted: 20195DescriptionAssume the coasting is an infinite straight line. La原创 2017-08-16 11:44:27 · 173 阅读 · 0 评论 -
删除游戏(贪心)
题意:给定一个正整数n,要求删除k个数,使得剩下的数码组成的数最小。限制条件:正整数的有效位数len可达240位,k例:输入:178543 4 18541397 4输出:131137思路:显然首先想到贪心,不过怎么贪心呢?每次删除最大的数?显然不对。观察第一个样例,从左到右考虑删除的第一个数字,显然删除从左到右递增序列的最后一个数字‘8’,重复此删除策略原创 2017-08-15 18:22:16 · 300 阅读 · 0 评论