会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
ch_hui
博客园
首页
新随笔
联系
订阅
管理
2020年5月22日
计蒜客 - 45276 D - number
摘要: 思路:这数据远远超过2^64,所以求答案时一定时高精度去算,我这里用了自己的高精度减减法模板和高精度乘低精度乘法模板,有兴趣可以深入理解里面的每一个意思。 算3的个数时不难,当n=1,ans1=1(10里面只有3),当n=2,ans2=19(100里有3.13.23.30.31...83.93)当n
阅读全文
posted @ 2020-05-22 22:23 ch_hui
阅读(177)
评论(0)
推荐(0)
2020年5月5日
2020劳动节天天乐(4)题解
摘要: A - 两只脑斧 题意:给你n个字符串,根据图判断呼还是吸还是停顿 思路:模拟,细心发现,偶数和7的时候是吸,0是停顿,其余是呼。 代码 1 #include<iostream> 2 #include<algorithm> 3 #include<vector> 4 #include<map> 5 #
阅读全文
posted @ 2020-05-05 17:53 ch_hui
阅读(216)
评论(0)
推荐(0)
2020年5月4日
2020劳动节四天乐(3)题解 Gym 102348(部分题解,后续更新)
摘要: A - Yellow Cards Gym - 102348A 题意:给你n张黄牌,第一队有a1个人,每人拿k1张黄牌就罚下;第二队有a2个人,每人拿k2张黄牌就罚下,求最小淘汰人数和最大淘汰人数 思路:贪心,最大淘汰人数比较好想,就优先淘汰k比较少的队伍,多了的就淘汰另一队伍分析就完事了。 最小淘汰
阅读全文
posted @ 2020-05-04 23:34 ch_hui
阅读(232)
评论(0)
推荐(0)
2020年4月26日
2020大一个人赛(10)题解 2018-2019 ACM-ICPC Pacific Northwest Regional Contest (Div. 1)
摘要: 2018-2019 ACM-ICPC Pacific Northwest Regional Contest (Div. 1)部分题 A - Exam 题意:给你k(朋友正确个数)和两个字符串(你和你朋友的答案),问你能答对的最大个数 思路:找你和朋友相同的个数,然后进行判断就行。 1 #includ
阅读全文
posted @ 2020-04-26 18:05 ch_hui
阅读(374)
评论(0)
推荐(0)
2020年4月24日
2020大一个人赛(9)题解
摘要: A-Rooms and Passages Gym 102215A 题意:给n个数,从起点出发,一直往右走,遇到一个前面出现过其相反数的正数就停下,问对于每个起点都能走多少步。 思路:倒着去递推 如果该点是正数,肯定能顺着走,ans[i]=ans[i+1]+1; 如果该点是负数,判断该相反数是否存在,
阅读全文
posted @ 2020-04-24 17:16 ch_hui
阅读(291)
评论(0)
推荐(1)
2020年4月16日
Codeforces Round #635 (Div. 2) C.Linova and Kingdom
摘要: 代码内容讲得比较清晰,慢慢细品吧·· #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #include<cmath> #include<vector> #include<queue> #include
阅读全文
posted @ 2020-04-16 10:37 ch_hui
阅读(116)
评论(0)
推荐(0)
2020年4月11日
You Are the One HDU - 4283 区间dp
摘要: 题意:有一队人排队,每个人焦虑因数di,每个等前面(k-1)个人的焦虑度为di*(k-1),问给你重新排序,最小焦虑度为多少。 思路:区间dp 该状态转移方程还是令人焦灼的,假设把所有人分成俩区间,一个[i+1,k],一个[k+1,j](i+1≤k<j) 如果d[i]先进去,则后面的焦灼度增加量为d
阅读全文
posted @ 2020-04-11 16:08 ch_hui
阅读(147)
评论(0)
推荐(0)
Brackets POJ 2955 区间dp
摘要: 题意:给出一个的只有'(',')','[',']'四种括号组成的字符串,求最长长度多少,end结束 思路:区间dp,dp[i][j]表示区间[i,j]符合要求的长度 #include<iostream> #include<algorithm> #include<cstring> #include<s
阅读全文
posted @ 2020-04-11 14:57 ch_hui
阅读(121)
评论(0)
推荐(0)
Monkey Party HDU 3506 区间dp
摘要: #include<iostream> #include<algorithm> #include<cstring> #include<stack> #include<cmath> #include<queue> using namespace std; #define ll long long #de
阅读全文
posted @ 2020-04-11 14:27 ch_hui
阅读(110)
评论(0)
推荐(0)
2020年4月7日
三分模板
摘要: while(l+1<r) { int lm=(l+r)>>1,rm=(lm+r)>>1; if(judge(lm)>judge(rm)) r=rm; else l=lm; } 下面是浮点 while(l+eps<r) { double lm=(l+r)/2,rm=(lm+r)/2; if(judge
阅读全文
posted @ 2020-04-07 17:23 ch_hui
阅读(140)
评论(0)
推荐(0)
下一页
公告