贪心
文章平均质量分 76
jerans
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Codeforces Round #301 (Div. 2)B. School Marks//CodeForces - 540B 贪心
B. School Markstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputLittle Vova studies programming in an elite原创 2017-02-10 22:45:39 · 306 阅读 · 0 评论 -
hdu 5414 CRB and String||QDUOJ GZS and String
https://www.qduoj.com/problem/6/题意是给两个字符串s,t,每次操作是在s的某个字符c后面添加一个字符d,但要求d!=c,问能不能经过某些操作后使构造出t串贪心几个感觉比较好的样例aaabaaaaabaNoaaabaaaabbbaYesbaabaaYesabbabbYescatca原创 2017-11-08 21:46:32 · 264 阅读 · 0 评论 -
hdu 4803 贪心
http://acm.split.hdu.edu.cn/showproblem.php?pid=4803题意是两个数,x,y,x指个数,y指价值总和,两种操作,操作1:x+1(个数加一,总和在加一个单价,也就是y+=y/x),操作2:y+1(总和加一,个数不变,其实也相当于单价变高),问你从x=1,y=1开始,到达给的某个x1,y1,最少需要几步操作可以去向单价方面考虑,既然要到达x1原创 2017-09-30 23:51:09 · 364 阅读 · 0 评论 -
H - Protecting the Flowers POJ - 3262 贪心
http://poj.org/problem?id=3262题意:n头牛在吃草,每秒吃di,你要驱赶这些牛,驱赶的时间2*ti,求怎么赶走全部牛,使总共吃最少的草(牛从你开始赶它就不在吃草看了题解才会。。。。。设已经x时刻两头牛,判断是否要交换赶牛的顺序di,tidj,tj先第i头在第j头吃的草:x*di+(x+2*ti)*dj先第j头在第i头吃的草:x原创 2017-07-20 23:18:42 · 324 阅读 · 0 评论 -
Codeforces Round #398 (Div. 2) B. The Queue
B. The Queuetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputFinally! Vasya have come of age and that means原创 2017-02-23 13:01:34 · 383 阅读 · 0 评论 -
CodeM美团点评编程大赛 初赛B轮 A 黑白树 贪心 E 子串 暴力
A题类似想到给多个区间,求最少多少个区间可以覆盖全部的问题,求法就是从当前这步能够到达的区间里,选一个下一步能到的最大值,对于本题,区别一是树形结构,不是一维的直线了,区别二是点都是连续的,不是离散的了,所以就可以把求法转化成记录,树形遍历,记录当前步这个范围里下一步能走的最大值。详见代码举两个样例方便理解input512321 2 3 2 1output原创 2017-06-25 17:36:42 · 1217 阅读 · 2 评论 -
CodeForces - 612D The Union of k-Segments
D. The Union of k-Segmentstime limit per test4 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given n segments on the原创 2017-05-22 17:26:52 · 417 阅读 · 0 评论 -
Codeforces Round #410 (Div. 2) C. Mike and gcd problem 贪心
C. Mike and gcd problemtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputMike has a sequence A = [a1, a2, ..原创 2017-04-22 09:43:53 · 639 阅读 · 1 评论 -
HDU - 5976 Detachment 贪心
DetachmentTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 895 Accepted Submission(s): 258Problem DescriptionIn a highly devel原创 2017-05-01 17:34:32 · 373 阅读 · 0 评论 -
CodeForces - 365D D. Free Market
D. Free Markettime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputJohn Doe has recently found a "Free Market" i原创 2017-03-08 21:32:46 · 703 阅读 · 0 评论 -
Bishops Alliance
F. Bishops Alliancetime limit per test9 secondsmemory limit per test256 megabytesinputbishops.inoutputstandard outputChessforces is coming into a great war. The原创 2017-03-03 12:12:45 · 365 阅读 · 0 评论 -
Codeforces Round #394 (Div. 2) C. Dasha and Password
C. Dasha and Passwordtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAfter overcoming the stairs Dasha cam原创 2017-02-01 11:23:53 · 300 阅读 · 0 评论 -
HDU 2209 C - 翻纸牌游戏
C - 翻纸牌游戏Time Limit:3000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit Status Practice HDU 2209Description有一种纸牌游戏,很有意思,给你N张纸牌,一字排开,纸牌有正反两面,开始的纸牌可能是一种乱的状态(有原创 2016-10-31 21:04:10 · 479 阅读 · 0 评论 -
HDU 5500 Reorder the Books
Reorder the BooksTime Li: 4000/2000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 1428 Accepted Submission(s): 752Problem Descriptiondxy has a原创 2016-11-23 19:39:09 · 316 阅读 · 0 评论 -
HDU 5744 Keep On Movin// 2016 Multi-University Training Contest 2
Keep On MovinTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1016 Accepted Submission(s): 716Problem DescriptionProfessor Zha原创 2016-11-23 19:18:42 · 316 阅读 · 0 评论 -
Codeforces Round #381 (Div. 2)C - Alyona and mex
C. Alyona and mextime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAlyona's mother wants to present an array原创 2016-11-24 02:37:25 · 449 阅读 · 0 评论 -
Codeforces Round #379 (Div. 2) C. Anton and Making Potions//734C
C. Anton and Making Potionstime limit per test4 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAnton is playing a very interes原创 2016-11-16 16:11:53 · 314 阅读 · 0 评论 -
Codeforces Round #398 (Div. 2) D. Cartons of milk
D. Cartons of milktime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputOlya likes milk very much. She drinks k原创 2017-02-20 19:42:07 · 326 阅读 · 0 评论 -
C. Naming Company 贪心
http://codeforces.com/contest/794/problem/C题意:两个人每个人有一个长度n的字符集合,构造一个长度为n的字符串A是希望字符串字典序越小越好,B希望字符串字典序越大越好贪心,首先可以明确A,B都有一个必选集合,A要选(n+1)/2个,必会选自己有的最小的前几个,B必选自己有的最大的前几个如果A当前能选的最小的小于B当前能选的最大的,那么必定是原创 2017-10-23 21:24:40 · 394 阅读 · 0 评论
分享