2021.1.30个人赛

本次比赛成绩有所进步,原因是过题速度较快,注意力比较高,赛前有练习手感尚存。不足是第一题wa了一次,小错误尚存,还是总结不够,练习不够。还有另外两个不算很难的题没有通过。原因是知识程度达不到。

总结:现在多做难度为第二题的题,尽量提高速度,做一道或两道第三题难度的题,在比赛时不用直接放弃。

补题:c题,题意很好理解,但是不会做。。。。就是让选最小的数,但要让他吃超过一半的糖。搜了题解,用了二分法。其实不难,但是没有想到。codeforces - 991c

#include <bits/stdc++.h>
using namespace std;
const int maxn = 10010, INF = 0x7fffffff;
typedef long long LL;
LL n, k;
int main()
{
scanf("%lld", &n);
if(n <= 42)
{
cout<< 1 <<endl;
return 0;
}
LL tmp = n;
LL l = 0, r = n;

while(l <= r)
{
LL sum = 0;
tmp = n;
LL mid = l + (r - l) / 2;
while(tmp > 0)
{
LL t = min(mid, tmp);
tmp -= t;
tmp -= tmp / 10;
sum += t;
}
if(sum >= (n+1) / 2) r = mid - 1;
else l = mid + 1;
}
cout<< l <<endl;


return 0;
}

d题:推dp,自己推不出来,尝试很多次不太行,看了网上代码有点不懂,先把题目放这codeforces - 991d。

 

posted @ 2021-02-08 17:18  yyscn  阅读(55)  评论(0)    收藏  举报