
贪心
文章平均质量分 83
Chen_Jr_
某个正在奋斗的ACMer
展开
-
Codeforces 964B(贪心)
题目链接:点击打开链接 题目描述:B. Messagestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are n incoming messages for Vasya. The i-th message is goi...原创 2018-04-18 13:53:22 · 243 阅读 · 0 评论 -
Gym 101915 G(贪心)
传送门题面:G. Robotstime limit per test5.0 smemory limit per test256 MBinputstandard inputoutputstandard outputThe Robotics Olympiad teams were competing in a contest.There was a tr...原创 2018-10-05 15:38:29 · 496 阅读 · 0 评论 -
Codeforces 1041C(贪心+set)
传送门题面:C. Coffee Breaktime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputRecently Monocarp got a job. His working day lasts exac...原创 2018-09-24 11:51:24 · 486 阅读 · 0 评论 -
Codeforces 1027D(Tarjan缩点+贪心)
传送门题面:D. Mouse Hunttime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputMedicine faculty of Berland State University has just fin...原创 2018-09-04 16:09:56 · 314 阅读 · 0 评论 -
Codeforces 1027C(贪心)
传送门题面:C. Minimum Value Rectangletime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou have nn sticks of the given lengths.Yo...原创 2018-09-04 15:49:22 · 358 阅读 · 0 评论 -
Codeforces 1029C(贪心)
传送门题面:C. Maximal Intersectiontime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given nn segments on a number line; eac...原创 2018-08-31 16:46:30 · 467 阅读 · 0 评论 -
Codeforces 1015D(贪心)
传送门题目描述: 在一条数轴上有编号为1到n的n座房子,每次必须移动,移动的距离为两点坐标之差的绝对值,问能否在k回合里一共移动s距离。题目分析: 我们考虑进行贪心。显然,当我们需要移动的距离s大于k次可以移动的最大值k*(n-1),以及当需要移动的步数小于k次可以移动的最小值k时,显然不符合题意。而显然在其他情况下人必定可以用各种方式成功移动的。 之后我们就...原创 2018-08-03 22:30:24 · 205 阅读 · 0 评论 -
2018牛客暑假多校二 D(贪心)
题目描述: 你要按照顺序以此经过n个商店,每到达一个商店你可以购买一件物品,也可以出售你手中的商品。 同一时刻你手上最多拿一件商品。在第i个商店购买和出售的代价都是a[i]。 问你经过完n个商店后的最大收益。 同时,在最大化收益的前提下,求最小的交易次数。题目分析: 不难发现,要想使得利益最大,我们肯定是要在一个单调区域中的最小值中购入,再从该单调区域的最大值时...原创 2018-07-21 21:18:48 · 287 阅读 · 0 评论 -
HDU 6299(多校第一场B)(贪心)
传送门题面:Balanced SequenceTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1188 Accepted Submission(s): 281Problem DescriptionChiaki h...原创 2018-07-24 09:18:23 · 318 阅读 · 0 评论 -
HDU 6301 (2018多校第一场D)(双指针贪心)
传送门题面:Distinct ValuesTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 705 Accepted Submission(s): 186Problem DescriptionChiaki has ...原创 2018-07-23 21:40:49 · 396 阅读 · 0 评论 -
Codeforces 1005C(贪心)
传送门题面:C. Summarize to the Power of Twotime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputA sequence a1,a2,…,ana1,a2,…,an is called good if, for each ...原创 2018-07-11 17:40:25 · 438 阅读 · 0 评论 -
Codeforces 1003D(贪心)
传送门题面:D. Coins and Queriestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPolycarp has nn coins, the value of the ii-th coin is aiai. It is guaran...原创 2018-07-09 18:44:40 · 671 阅读 · 0 评论 -
Codeforces 988E(贪心+模拟)
传送门题面:E. Divisibility by 25time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given an integer nn from 11 to 10181018 without leading zeroes.I...原创 2018-06-02 16:14:08 · 879 阅读 · 2 评论 -
BZOJ 1024(贪心)
传送门题面:1034: [ZJOI2008]泡泡堂BNBTime Limit: 10 Sec Memory Limit: 162 MBSubmit: 4015 Solved: 2093[Submit][Status][Discuss]Description 第XXXX届NOI期间,为了加强各省选手之间的交流,组委会决定组织一场省际电子竞技大赛,每一个省的代表队由n名...原创 2018-10-23 20:50:23 · 182 阅读 · 0 评论