随笔分类 -  ACM-贪心

摘要:DreamGrid has a nonnegative integer . He would like to divide into nonnegative integers and minimizes their bitwise or (i.e. and should be as small as 阅读全文
posted @ 2018-10-14 20:18 StarHai 阅读(608) 评论(0) 推荐(0) 编辑
摘要:BaoBao has just found a string of length consisting of 'C' and 'P' in his pocket. As a big fan of the China Collegiate Programming Contest, BaoBao thi 阅读全文
posted @ 2018-10-14 20:09 StarHai 阅读(434) 评论(0) 推荐(0) 编辑
摘要:The 2017 China Collegiate Programming Contest Qinhuangdao Site is coming! There will be teams participating in the contest, and the contest will be he 阅读全文
posted @ 2018-10-14 20:05 StarHai 阅读(598) 评论(0) 推荐(0) 编辑
摘要:hiaki has an array of nn positive integers. You are told some facts about the array: for every two elements aiai and ajaj in the subar... 阅读全文
posted @ 2018-07-25 21:18 StarHai 阅读(352) 评论(0) 推荐(0) 编辑
摘要:B. Light It Uptime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputRecently, you bough... 阅读全文
posted @ 2018-06-28 22:59 StarHai 阅读(378) 评论(0) 推荐(0) 编辑
摘要:D. Equalize the Remainderstime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou ar... 阅读全文
posted @ 2018-06-28 19:07 StarHai 阅读(411) 评论(0) 推荐(0) 编辑
摘要:描述题解二分加贪心。先确保前 ii 桶可以分配为相邻的 kk 个,并且保证 a[i∗k+j]−a[1]#include#includeusing namespace std;const int MAXN = 1e5 + 10;int n, k, l;int a[MAX... 阅读全文
posted @ 2018-05-30 22:31 StarHai 阅读(164) 评论(0) 推荐(0) 编辑
摘要:Description 小闪最近迷上了二刀流——不过他耍的其实是剑——新买了一个宝库用来专门存放自己收集的双剑。一对剑有两把,分只能左手用的和只能右手用的,各自有一个攻击力数值。虽然一对剑在小闪刚拿到时是一对,不过其实可以认为它们是独立的两把剑。一对剑的攻击力是左右两把剑的攻击力之和,小闪可以自由地 阅读全文
posted @ 2018-05-14 23:14 StarHai 阅读(221) 评论(0) 推荐(0) 编辑
摘要:A New Year party is not a New Year party without lemonade! As usual, you are expecting a lot of guests, and buying lemonade has alread... 阅读全文
posted @ 2018-03-09 21:48 StarHai 阅读(319) 评论(0) 推荐(0) 编辑
摘要:You are preparing for an exam on scheduling theory. The exam will last for exactly Tmilliseconds and will consist of n problems. You can either solve 阅读全文
posted @ 2018-03-09 21:45 StarHai 阅读(318) 评论(0) 推荐(0) 编辑
摘要:There are n pearls in a row. Let's enumerate them with integers from 1 to n from the left to the right. The pearl number i has the typ... 阅读全文
posted @ 2018-03-09 21:42 StarHai 阅读(212) 评论(0) 推荐(0) 编辑
摘要:度度熊喜欢着喵哈哈村的大明星——星星小姐。 为什么度度熊会喜欢星星小姐呢? 首先星星小姐笑起来非常动人,其次星星小姐唱歌也非常好听。 但这都不是最重要的,最重要的是,星星小姐拍的一手好代码! 于是度度熊关注了星星小姐的贴吧。 一开始度度熊决定每天都在星星小姐的贴吧里面签到。 但是度度熊是一个非常健忘 阅读全文
posted @ 2018-03-04 23:14 StarHai 阅读(329) 评论(0) 推荐(0) 编辑
摘要:Demy has n jewels. Each of her jewels has some value vi and weight wi. Since her husband John got broke after recent financial crises, Demy has decide 阅读全文
posted @ 2018-01-29 21:34 StarHai 阅读(226) 评论(0) 推荐(0) 编辑
摘要:Assume the coasting is an infinite straight line. Land is in one side of coasting, sea in the other. Each small island is a point loca... 阅读全文
posted @ 2018-01-29 20:44 StarHai 阅读(144) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示