
贪心
提比-我有特殊的AC技巧
这个作者很懒,什么都没留下…
展开
-
Bin Packing - UVALive 3503 贪心
Bin PackingTime Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %lluDescriptionA set of n 1-dimensional items have to be packed in identical bins. All bins have exactl原创 2014-06-25 19:36:38 · 802 阅读 · 0 评论 -
Minimal coverage - UVa 10020 贪心
题意:用最少的线铺满0-m。思路:贪心,每次找到当前状态下能铺到的最远的线。AC代码如下:#include#include#includeusing namespace std;struct node{ int l,r,num;}line[100010];bool cmp(node a,node b){ return a.l<b.l;}int T,t原创 2015-03-01 15:37:28 · 519 阅读 · 0 评论 -
EDITOR NOTTOOBAD - UVa 10602 贪心
Company Macrohard has released it’s new version of editor Nottoobad, which can understand a few voice commands. Unfortunately, there are only two voice commands that it can understand – “repeat the la原创 2015-02-28 18:45:08 · 466 阅读 · 0 评论 -
Shoemaker's Problem - UVa 10026 贪心
题意:一个鞋匠做鞋,每个鞋都有制作的时间,和延迟制作的处罚,问怎样的顺序才能使处罚达到最低。多种答案的情况下取字典序最小。思路:贪心地去做,每次优先做S/t最大的,同样的情况下,先做标号最小的,保证字典序最小。AC代码如下:#include#include#includeusing namespace std;struct node{ int x,y,num;}bo原创 2015-02-28 15:00:35 · 445 阅读 · 0 评论 -
Cleaning Shifts - POJ 2376 贪心
Cleaning ShiftsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 11447 Accepted: 2982DescriptionFarmer John is assigning some of his N (1 <= N <= 25,000原创 2014-10-25 20:11:53 · 586 阅读 · 0 评论 -
Stall Reservations - POJ 3190 贪心
Stall ReservationsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 3063 Accepted: 1104 Special JudgeDescriptionOh those picky N (1 <= N <= 50,000)原创 2014-10-26 13:09:38 · 665 阅读 · 0 评论 -
Allowance - POJ 3040 贪心
AllowanceTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 1554 Accepted: 644DescriptionAs a reward for record milk production, Farmer John has decided原创 2014-10-26 17:19:37 · 676 阅读 · 0 评论 -
Radar Installation - POJ 1328 贪心
Radar InstallationTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 54211 Accepted: 12195DescriptionAssume the coasting is an infinite straight line. La原创 2014-10-26 11:02:33 · 530 阅读 · 0 评论 -
Protecting the Flowers - POJ 3262 贪心
Protecting the FlowersTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 4381 Accepted: 1772DescriptionFarmer John went to cut some wood and left N (2 ≤原创 2014-10-26 21:56:54 · 613 阅读 · 0 评论 -
最少拦截系统 - HDU 1257 贪心 或 dp
最少拦截系统Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 18597 Accepted Submission(s): 7343Problem Description某国为了防御敌国的导弹袭击,发展出一原创 2014-08-13 22:23:24 · 501 阅读 · 0 评论 -
Jzzhu and Chocolate - CF 449C 贪心
Jzzhu and Chocolatetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputJzzhu has a big rectangular chocolate ba原创 2014-07-20 11:58:37 · 857 阅读 · 0 评论 -
Add All - UVa 10954 优先队列
Add AllInput: standard inputOutput: standard outputYup!! The problem name reflects your task; just add a set of numbers. But you may feel yourselves condescended, to write a C/C++ program ju原创 2015-03-02 08:27:39 · 466 阅读 · 0 评论