![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
二分
mosquito_zm
这个作者很懒,什么都没留下…
展开
-
Codeforces Round #402 (Div. 2) D(简单)(二分)
题目链接 题解:水题,二分法,暴力判断即可。 PS:下次看到求最值的题,一定要想到二分法。如果是最小值最大类问题,十成有十成是二分法! 代码如下: #include #include #include #include using namespace std; const int maxn = 2e5 + 10; char s1[maxn],s2[maxn]; int a[maxn原创 2017-03-22 10:50:07 · 277 阅读 · 0 评论 -
Codeforces Round #404 (Div. 2) C(数学)(精度)
题目链接 题目解答:显然,这是一道数学题。先考虑特殊情况,nm时,经过计算可得,答案为ans = ceil((sqrt(8 * (n - m) + 1) - 1) / 2); 但是直接计算会有精度误差。所以我的解决办法是先将计算出来的结果减去100,再用一个whlie循环一个一个的加,并判断当前结果是否满足原始的算式。(微调结果)) PS: long double 好像不能用printf原创 2017-03-22 13:31:46 · 530 阅读 · 0 评论 -
Codeforces Round #427 (Div. 2) E. The penguin's game(交互+思维+二分)
题目链接 原版题解: The solution can be separated into several parts. I. Finding the parity of the number of special icicles in the given subset using 1 question. Consider the following cases: S原创 2017-08-10 09:58:21 · 220 阅读 · 0 评论