
题目
文章平均质量分 59
Jakon_
这个作者很懒,什么都没留下…
展开
-
[三分] Party All the Time
In the Dark forest, there is a Fairy kingdom where all the spirits will go together and Celebrate the harvest every year. But there is one thing you may not know that they hate walking so much that they would prefer to stay at home if they need to walk a l原创 2021-11-01 23:33:38 · 129 阅读 · 0 评论 -
[贪心] Aaronson
Recently, Peter saw the equation x0+2x1+4x2+...+2mxm=nx0+2x1+4x2+...+2mxm=n . He wants to find a solution (x0,x1,x2,...,xm)(x0,x1,x2,...,xm) in such a manner that ∑i=0mxi∑i=0mxi is minimum and every xixi (0≤i≤m0≤i≤m ) is non-negative. (原题面如下,更容易阅读) ..原创 2021-10-27 00:04:24 · 173 阅读 · 0 评论 -
Luntik and Subsequences
Thought: 容易得出规律,满足条件的子数组数量为:cnt1 * 2^cnt0。 Attention: ①用c/c++语言,很容易想到用pow函数,但是!容易出现问题:pow函数变量是double型,而我们的cnt0为int型,所以可以自定义函数。 ②虽然ai的范围在int型之内,但数组长度可达60,也就是说,子数组数量可能达到大概2^60是一个很大的数,最好用long long做函数返回值。 Code: // #define LOCAL #include <...原创 2021-10-25 13:24:17 · 311 阅读 · 0 评论