
贪心
文章平均质量分 79
寒江雪里独钓着的蓑笠翁
退役XCPCer,AI搬砖狗
展开
-
URAL1876 - Centipede's Morning - 贪心
Centipede’s Morning 题目链接 分类:greedy1.题意概述一只蜈蚣有40条左腿和40条右腿。它有a只左鞋和b只右鞋。穿一只左鞋2s,穿一只右鞋1s,扔鞋1s。问给所有脚都穿上鞋最坏需要多长时间?2.解题思路时间最长就两种情况: 拿所有右脚去试左脚,再穿回左脚,这样就是2b+402b+40。先给39只右脚穿上鞋,然后再给左脚穿上所有的鞋,然后再把所有的剩原创 2017-08-07 14:37:58 · 321 阅读 · 0 评论 -
北理2017校赛 - B.XC的缎带 - 排序+贪心
1.题目描述:B.XC的缎带(黄色)成绩0开启时间2017年05月14日 Sunday 09:30折扣0.8折扣时间2017年05月12日 Friday 19:55允许迟交是关闭时间2017年05月14日 Sunday 15:00题目描述女孩子都喜欢漂亮的缎带,XC也不例原创 2017-05-16 19:44:26 · 636 阅读 · 0 评论 -
CF - 805C. Find Amir - 贪心思维+构造
1.题目描述:C. Find Amirtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputA few years ago Sajjad l原创 2017-05-06 15:43:03 · 337 阅读 · 0 评论 -
CF - 805B. 3-palindrome - 贪心+构造
1.题目描述:B. 3-palindrometime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputIn the beginning of the new yea原创 2017-05-05 18:48:37 · 495 阅读 · 0 评论 -
CF - 803D. Magazine Ad - 二分+贪心
1.题目描述:D. Magazine Adtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe main city magazine offers it原创 2017-05-05 18:13:06 · 419 阅读 · 0 评论 -
CF - 794C. Naming Company - 贪心+排序+模拟+字符串处理
1.题目描述:C. Naming Companytime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputOleg the client and Igor the原创 2017-05-13 20:58:42 · 941 阅读 · 0 评论 -
CF - 803A. Maximal Binary Matrix - 思维+贪心
题目描述:A. Maximal Binary Matrixtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given matrix with原创 2017-05-03 23:11:26 · 397 阅读 · 0 评论 -
CF - 797C. Minimal string - 贪心+栈处理+字符串处理
题目描述:C. Minimal stringtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputPetya recieved a gift o原创 2017-05-03 22:58:07 · 606 阅读 · 0 评论 -
CF - 797B. Odd sum - 贪心
题目描述:B. Odd sumtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given sequence a1, a2,原创 2017-05-03 22:51:49 · 543 阅读 · 0 评论 -
CF - 797A. k-Factorization - 思维+贪心+数学
题目描述:A. k-Factorizationtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputGiven a positive inte原创 2017-05-03 22:45:30 · 350 阅读 · 0 评论 -
CF - 801B. Valued Keys - 构造+贪心
1.题目描述:B. Valued Keystime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou found a mysterious function原创 2017-04-20 19:56:30 · 1179 阅读 · 0 评论 -
CF - 807B. T-Shirt Hunt - 贪心+模拟
1.题目描述:B. T-Shirt Hunttime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputNot so long ago the Codecraft-原创 2017-05-08 21:39:36 · 739 阅读 · 0 评论 -
CF - 808C. Tea Party - 排序+贪心
1.题目描述:C. Tea Partytime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputPolycarp invited all his friends t原创 2017-05-18 20:15:43 · 372 阅读 · 0 评论 -
CF - 808E. Selling Souvenirs - 01背包dp+排序+贪心/三分优化
1.题目描述:E. Selling Souvenirstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAfter several latest refo原创 2017-05-18 20:42:02 · 845 阅读 · 1 评论 -
Codeforces - 720A. Closing ceremony - 贪心
Closing ceremony 题目链接 分类:greedy1.题目描述n×mn×m个座位, 有n×mn×m个人,一开始有 kk 个人在(0,0)(0,0)点上,ll 个人在(0,m+1)(0,m+1)点上,每个人有对应的体力值,体力值即为可以行走的距离(曼哈顿距离),问是否存在一种方案是每个人花费的体力不超过上限,且每个人都有位置坐。2.解题思路对于前 kk 个人,我们按照原创 2017-08-05 15:57:59 · 458 阅读 · 3 评论 -
Codeforces - 35D. Animals - 贪心+排序
Animals 题目链接 分类: greedy1.题意概述有某类动物,要在农场中待n(1 ≤ n ≤ 100)n(1 ≤ n ≤ 100)天,第ii天,这类动物要吃的粮食为cic_i,现在初始粮草是X(1≤X≤104)X(1≤X≤10^4),问你最多可以容纳几只动物(动物可以中途来,但是不能中途走)?2.解题思路我们先把第i天到最后1天所需的粮食求出来,再排序一下,然后贪心地选原创 2017-08-13 12:03:14 · 522 阅读 · 0 评论 -
URAL1820 - Ural Steaks - 贪心
Ural Steaks 题目链接 分类:贪心1.题意概述n块肉、1个锅,但是这个锅只能同时烤k块,而且每块肉要烤2面,每面要1分钟,问煎完n块的最少时间?2.解题思路先让所有的肉都先煎一面,然后考虑第二面要让锅的空间尽可能地利用,当2n%k=02n\%k=0时,我们可以通过顺序的调整让锅的空间都利用上,否则还需要一次多余的。 trick点: n=6,k=4,ans=2n=6,原创 2017-08-05 14:55:21 · 247 阅读 · 0 评论 -
Codeforces - 478C. Table Decorations - 思维、贪心
Table Decorations 题目链接 分类:思维、贪心1.题意概述给你三种颜色的气球Red、Green、Black和他们各自的个数,现在每张桌子要用三个气球装饰,要求同一张桌子的气球颜色不能完全相同,现在问你用这些气球能够最多装饰几张桌子?2.解题思路我们不关心具体方案,假设三种颜色气球数量从小到大分别是a,b,ca,b,c,显然如果>c>2(a+b)>c>2(a+b)原创 2017-07-05 17:36:51 · 417 阅读 · 0 评论 -
Codeforces - 777B. Game of Credit Cards 贪心
1.题目描述:B. Game of Credit Cardstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAfter the fo原创 2017-02-24 22:25:27 · 365 阅读 · 0 评论 -
Codeforces - 831D. Office Keys - dp、二分+贪心
D. Office Keys 题目链接 分类:dp、二分、贪心1.题意概述一个坐标轴上有n个人,他们坐标分别为a[1...n]a[1...n],而且有k把钥匙坐标分别在b[1...k]b[1...k],现在办公室们在坐标为p的位置,每个人必须要拿到唯一一把钥匙进入办公室们,不同人之间不能共用,问你所有人进入办公室的最短时间是多少?数据范围:1 ≤ n ≤ 1 000,n ≤ k原创 2017-07-14 18:46:36 · 482 阅读 · 0 评论 -
Codeforces - 299C. Weird Game - 贪心、博弈
Weird Game 题目链接 分类:贪心1.题意概述AB各有长度为2n的01串,每次轮流在1~2n里选一个之前双方没选过的数,那么他可以得到他的串里对应位置的数字。 最后AB各得到n个数字,他们将其任意排列后做比较。若双方都是最优策略,问你谁会赢?2.解题思路我们这样考虑如果一个位置双方都是1,显然两个人都优先选这个,因为不想让对方得到更多的1。又由于A先手,它取完所能取的1原创 2017-07-14 10:08:44 · 674 阅读 · 0 评论 -
LightOJ1106 - Gone Fishing - 贪心
Gone Fishing 题目链接 分类:枚举、贪心1.题意概述n个池塘,从第i到第i+1个池塘需要5t[i]5t[i]分钟,第i个池塘第一次捕鱼可以捕到f[i]条鱼,之后每五分钟减少d[i]条(如果池塘中鱼的数量已经小于d[i]则减少到0条),起点在第1个池塘,问h小时内最多可以捕多少鱼?2.解题思路由于John可以在任意的一个湖结束钓鱼,因此可以枚举他结束钓鱼的湖,求出相应原创 2017-07-13 10:52:14 · 296 阅读 · 0 评论 -
CF - 810B. Summer sell-off - 贪心+排序
1.题目描述:B. Summer sell-offtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputSummer holidays! Someone is原创 2017-05-21 16:35:30 · 889 阅读 · 0 评论 -
CF - 812C. Sagheer and Nubian Market - 暴力+排序贪心+二分
1.题目描述:C. Sagheer and Nubian Markettime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputOn his trip to Lu原创 2017-06-05 22:34:27 · 404 阅读 · 0 评论 -
HDU2795 - Billboard - 贪心+线段树log内查询更新
1.题目描述:BillboardTime Limit: 20000/8000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 21405 Accepted Submission(s): 8821Problem DescriptionA原创 2017-04-14 16:04:45 · 346 阅读 · 0 评论 -
CF - 789A. Anastasia and pebbles - 贪心+模拟
1.题目描述:A. Anastasia and pebblestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputAnastasia loves going原创 2017-04-02 12:32:35 · 430 阅读 · 0 评论 -
CF - 766B. Mahmoud and a Triangle - 排序+贪心
1.题目描述:B. Mahmoud and a Triangletime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputMahmoud ha原创 2017-03-03 21:04:10 · 359 阅读 · 0 评论 -
HDU4550 - 卡片游戏 - 贪心+模拟
1.题目描述:卡片游戏Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 2340 Accepted Submission(s): 700Problem Description 小明最近宅在家原创 2017-03-03 21:00:11 · 318 阅读 · 0 评论 -
HDU1050 - Moving Tables - 思维(可贪心)
1.题目描述:Moving TablesTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 33988 Accepted Submission(s): 11149Problem Description原创 2017-03-03 20:52:21 · 252 阅读 · 0 评论 -
HDU2037 - 今年暑假不AC - 贪心
1.题目描述:今年暑假不ACTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 54294 Accepted Submission(s): 29210Problem Description“今年原创 2017-03-03 20:49:33 · 194 阅读 · 0 评论 -
HDU1009 - FatMouse' Trade - 贪心
1.题目描述:FatMouse' TradeTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 73381 Accepted Submission(s): 25200Problem Descriptio原创 2017-03-03 20:44:50 · 250 阅读 · 0 评论 -
HUD2217 - Visit 贪心+排序+暴力
1.题目描述:VisitTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 855 Accepted Submission(s): 286Problem DescriptionWangye is原创 2017-02-24 11:02:20 · 412 阅读 · 0 评论 -
CF - 555B. Case of Fugitive 排序+贪心
1.题目描述:B. Case of Fugitivetime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAndrewid the Android is a原创 2017-03-01 21:05:43 · 334 阅读 · 0 评论 -
CF - 472C. Design Tutorial: Make It Nondeterministic 贪心+字符串+模拟
1.题目描述:C. Design Tutorial: Make It Nondeterministictime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputA原创 2017-03-01 20:14:40 · 359 阅读 · 0 评论 -
CF - 596B. Wilbur and Array 贪心
1.题目描述:B. Wilbur and Arraytime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputWilbur the pig is tinkerin原创 2017-02-28 19:09:16 · 244 阅读 · 0 评论 -
CFGym - 100712C.Street Lamps 贪心+模拟
1.题目描述:C. Street LampsBahosain is walking in a street of Nblocks. Each block is either empty or has one lamp. If there is a lamp in ablock, it will light it’s block and the direct adjacent blocks原创 2017-02-28 19:38:36 · 1044 阅读 · 0 评论 -
CF - 762B. USB vs. PS/2 - 贪心+排序
1.题目描述:B. USB vs. PS/2time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputDue to the increase in the num原创 2017-03-03 21:06:32 · 360 阅读 · 0 评论 -
CF - 757B. Bash's Big Day - 贪心+暴力
1.题目描述:B. Bash's Big Daytime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputBash has set out on a journe原创 2017-03-03 21:10:59 · 790 阅读 · 0 评论 -
CF - 754A.Lesha and array splitting - 贪心+思维
1.题目描述:A. Lesha and array splittingtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputOne spr原创 2017-03-03 21:16:30 · 410 阅读 · 0 评论 -
CF - 795C. Maximum Number - 贪心+思维
1.题目描述:C. Maximum Numbertime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputStepan has the newe原创 2017-04-09 19:38:19 · 527 阅读 · 0 评论