![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
贪心
文章平均质量分 75
black_miracle
这个作者很懒,什么都没留下…
展开
-
UVA 11134 贪心
题意:在一个n*n的棋盘上放置n个车,使得它们之间都不能互相攻击(任意两个车都不能同行或同列),并且,对于第i个车,限制它只能放在一个矩形区域内,(xli, yli),这个矩形的左上角顶点坐标是(xli, yli),右下角顶点坐标是 (xri, yri), 1 ≤ i ≤ n, 1 ≤ xli ≤ xri ≤ n, 1 ≤ yli ≤ yri ≤ n.做法:因为x和y互不影响,所以原创 2016-04-29 21:11:04 · 319 阅读 · 0 评论 -
ZOJ 3953 贪心+优先队列
IntervalsTime Limit: 1 Second Memory Limit: 65536 KB Special JudgeChiaki has n intervals and the i-th of them is [li, ri]. She wants to delete some intervals so that there does n原创 2017-04-10 12:27:02 · 490 阅读 · 0 评论 -
Codeforces 449C 贪心
Jzzhu and Applestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputJzzhu has picked n apples from his big appl原创 2017-02-27 10:53:04 · 256 阅读 · 0 评论 -
Codeforces 777E 贪心
Hanoi Factorytime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputOf course you have heard the famous task about原创 2017-02-25 12:31:02 · 1029 阅读 · 0 评论 -
摇钱树 dp+贪心
摇钱树Time Limit: 1000MS Memory Limit: 1000KTotal Submissions: 106 Accepted: 33DescriptionCpg 正在游览一个梦中之城,在这个城市中有n棵摇钱树。。。这下,可让Cpg看傻了。。。可是Cpg只能在这个城市中呆K天,但是现在摇钱树已经成原创 2017-02-23 17:16:16 · 383 阅读 · 0 评论 -
Codeforces Round #380 Subordinates 贪心
Subordinatestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are n workers in a company, each of them has a unique id from 1 to n. Exaclty one原创 2016-11-21 16:57:48 · 231 阅读 · 0 评论 -
Codeforces 767D 贪心
Cartons of milktime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputOlya likes milk very much. She drinks k car原创 2017-02-20 22:34:48 · 345 阅读 · 0 评论 -
Codeforces 758D 贪心
Ability To Converttime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputAlexander is learning how to convert numb原创 2017-01-21 17:56:08 · 305 阅读 · 0 评论 -
HDU 5976 逆元
DetachmentTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Problem DescriptionIn a highly developed alien society, the habitats are almost infinite dime原创 2016-11-06 21:24:15 · 1642 阅读 · 0 评论 -
Codeforces 706d 字典树+贪心
Vasiliy's Multisettime limit per test4 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAuthor has gone out of the stories about原创 2016-08-13 23:36:26 · 401 阅读 · 0 评论 -
HDU 5695 拓扑排序+贪心
Gym ClassTime Limit: 6000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Problem Description众所周知,度度熊喜欢各类体育活动。今天,它终于当上了梦寐以求的体育课老师。第一次课上,它发现一个有趣的事情。在上课之前,所有同学要排成一列, 假设最开原创 2016-08-09 18:10:13 · 346 阅读 · 0 评论 -
POJ 3262 贪心
Protecting the FlowersCrawling in process...Crawling failedTime Limit:2000MS Memory Limit:65536KB DescriptionFarmer John went to cut some wood and left N (2 ≤N ≤ 100,000) c原创 2016-05-11 01:16:46 · 662 阅读 · 0 评论 -
POJ 3190 贪心
Stall ReservationsCrawling in process...Crawling failedTime Limit:1000MS Memory Limit:65536KBDescriptionOh those picky N (1 <= N <= 50,000) cows! They are so picky that each o原创 2016-05-10 00:51:41 · 635 阅读 · 0 评论 -
POJ 1328 贪心
题意:给你n个海岛,一个d,代表雷达范围,每个海岛的坐标,现在你只能在x轴上建雷达,问探测到所有海岛最少需要多少个雷达,如果不能探测到所有的,输出-1。做法:贪心,将每个灯塔预处理为[l,r]范围,然后问题就变成了,给你n个区间,用最少的点使得所有的区间都至少含有一个点。#include#include#include#includeusing namespace原创 2016-05-10 00:50:50 · 418 阅读 · 0 评论 -
POJ 2376 贪心
Cleaning ShiftsCrawling in process...Crawling failedTime Limit:1000MS Memory Limit:65536KB DescriptionFarmer John is assigning some of his N (1 <= N <= 25,000) cows to do som原创 2016-05-09 16:59:27 · 815 阅读 · 0 评论 -
codeforces 1061D
传送门:https://codeforces.com/contest/1061/problem/D题意:给你n个节目,每个节目会在[l,r]区间播放,在[a,b]时间租一台电视需要花费x+y*(b-a),一台电视只能同时看一个节目,问最少需要多少钱能看所有节目。题解:贪心,先对节目从左到右排序,然后看当前是要租一台新的电视好还是旧的续租好。#include<bits/stdc+...原创 2019-01-24 10:35:24 · 356 阅读 · 0 评论