随笔分类 - 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
阅读全文
摘要: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
阅读全文
摘要:The 2017 China Collegiate Programming Contest Qinhuangdao Site is coming! There will be teams participating in the contest, and the contest will be he
阅读全文
摘要: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...
阅读全文
摘要:B. Light It Uptime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputRecently, you bough...
阅读全文
摘要:D. Equalize the Remainderstime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou ar...
阅读全文
摘要:描述题解二分加贪心。先确保前 ii 桶可以分配为相邻的 kk 个,并且保证 a[i∗k+j]−a[1]#include#includeusing namespace std;const int MAXN = 1e5 + 10;int n, k, l;int a[MAX...
阅读全文
摘要:Description 小闪最近迷上了二刀流——不过他耍的其实是剑——新买了一个宝库用来专门存放自己收集的双剑。一对剑有两把,分只能左手用的和只能右手用的,各自有一个攻击力数值。虽然一对剑在小闪刚拿到时是一对,不过其实可以认为它们是独立的两把剑。一对剑的攻击力是左右两把剑的攻击力之和,小闪可以自由地
阅读全文
摘要: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...
阅读全文
摘要: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
阅读全文
摘要: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...
阅读全文
摘要:度度熊喜欢着喵哈哈村的大明星——星星小姐。 为什么度度熊会喜欢星星小姐呢? 首先星星小姐笑起来非常动人,其次星星小姐唱歌也非常好听。 但这都不是最重要的,最重要的是,星星小姐拍的一手好代码! 于是度度熊关注了星星小姐的贴吧。 一开始度度熊决定每天都在星星小姐的贴吧里面签到。 但是度度熊是一个非常健忘
阅读全文
摘要: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
阅读全文
摘要: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...
阅读全文