读懂了题就会发现这是个超级大水题 Description Gerald has n younger brothers and their number happens to be even. One day he bought n2 candy bags. One bag has one candy, one bag has two candies, one bag has three candies and so on. In fact, for each integer k from 1 t…
A. Candy Bags http://codeforces.com/problemset/problem/334/A time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Gerald has n younger brothers and their number happens to be even. One day he…
A. Candy Bags time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Gerald has n younger brothers and their number happens to be even. One day he bought n2 candy bags. One bag has one candy, one…
A. Candy Bags time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Gerald has n younger brothers and their number happens to be even. One day he bought n2 candy bags. One bag has one candy, one…
Kids like candies, so much that they start beating each other if the candies are not fairly distributed. So on your next party, you better start thinking before you buy the candies. If there are KK kids, we of course need K⋅XK⋅X candies for a fair di…
A. Candy Bagstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputGerald has n younger brothers and their number happens to be even. One day he bought n2 candy bags. One bag has one candy, one bag has t…
A. Candy Bags 总糖果数\(\frac{n^2(n^2+1)}{2}\),所以每人的数量为\(\frac{n}{2}(n^2+1)\) \(n\)是偶数. B. Eight Point Sets 模拟. C. Secrets 将\(n\)转成3进制数,考虑最后一位非0位,没有刚好\(n\)的数量为非0位的前一位加1,当前位置0,最后将钱都转化为最低单位. D. Chips 在没有障碍的情况下,有冲突的列.行,我们可以找到一个排列解决冲突. 除了\(n\)是奇数时的中心点无法解决冲突.…
There are N children standing in a line. Each child is assigned a rating value. You are giving candies to these children subjected to the following requirements: Each child must have at least one candy. Children with a higher rating get more candies…