
贪心
文章平均质量分 76
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 · 357 阅读 · 0 评论 -
ZOJ 3953 贪心+优先队列
Intervals Time Limit: 1 Second Memory Limit: 65536 KB Special Judge Chiaki 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 · 542 阅读 · 0 评论 -
Codeforces 449C 贪心
Jzzhu and Apples time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Jzzhu has picked n apples from his big appl原创 2017-02-27 10:53:04 · 303 阅读 · 0 评论 -
Codeforces 777E 贪心
Hanoi Factory time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Of course you have heard the famous task about原创 2017-02-25 12:31:02 · 1116 阅读 · 0 评论 -
摇钱树 dp+贪心
摇钱树 Time Limit: 1000MS Memory Limit: 1000K Total Submissions: 106 Accepted: 33 Description Cpg 正在游览一个梦中之城,在这个城市中有n棵摇钱树。。。这下,可让Cpg看傻了。。。可是Cpg只能在这个城市中呆K天,但是现在摇钱树已经成原创 2017-02-23 17:16:16 · 449 阅读 · 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 · 264 阅读 · 0 评论 -
Codeforces 767D 贪心
Cartons of milk time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Olya likes milk very much. She drinks k car原创 2017-02-20 22:34:48 · 385 阅读 · 0 评论 -
Codeforces 758D 贪心
Ability To Convert time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Alexander is learning how to convert numb原创 2017-01-21 17:56:08 · 371 阅读 · 0 评论 -
HDU 5976 逆元
Detachment Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Problem Description In a highly developed alien society, the habitats are almost infinite dime原创 2016-11-06 21:24:15 · 1718 阅读 · 0 评论 -
Codeforces 706d 字典树+贪心
Vasiliy's Multiset time limit per test 4 seconds memory limit per test 256 megabytes input standard input output standard output Author has gone out of the stories about原创 2016-08-13 23:36:26 · 463 阅读 · 0 评论 -
HDU 5695 拓扑排序+贪心
Gym Class Time Limit: 6000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Problem Description 众所周知,度度熊喜欢各类体育活动。 今天,它终于当上了梦寐以求的体育课老师。第一次课上,它发现一个有趣的事情。在上课之前,所有同学要排成一列, 假设最开原创 2016-08-09 18:10:13 · 379 阅读 · 0 评论 -
POJ 3262 贪心
Protecting the Flowers Crawling in process... Crawling failed Time Limit:2000MS Memory Limit:65536KB Description Farmer John went to cut some wood and left N (2 ≤ N ≤ 100,000) c原创 2016-05-11 01:16:46 · 700 阅读 · 0 评论 -
POJ 3190 贪心
Stall Reservations Crawling in process... Crawling failed Time Limit:1000MS Memory Limit:65536KB Description Oh those picky N (1 <= N <= 50,000) cows! They are so picky that each o原创 2016-05-10 00:51:41 · 683 阅读 · 0 评论 -
POJ 1328 贪心
题意:给你n个海岛,一个d,代表雷达范围,每个海岛的坐标,现在你只能在x轴上建雷达,问探测到所有海岛最少需要多少个雷达,如果不能探测到所有的,输出-1。 做法:贪心,将每个灯塔预处理为[l,r]范围,然后问题就变成了,给你n个区间,用最少的点使得所有的区间都至少含有一个点。 #include #include #include #include using namespace原创 2016-05-10 00:50:50 · 487 阅读 · 0 评论 -
POJ 2376 贪心
Cleaning Shifts Crawling in process... Crawling failed Time Limit:1000MS Memory Limit:65536KB Description Farmer John is assigning some of his N (1 <= N <= 25,000) cows to do som原创 2016-05-09 16:59:27 · 852 阅读 · 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 · 431 阅读 · 0 评论