会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Live2D
Hoyoak
伏笔止留白,放空至物外
博客园
首页
新随笔
联系
订阅
管理
[置顶]
知识索引
摘要: 持续upddate中,非按难度排序 一,基础算法 1,搜索 (深度优先搜索 广度优先搜索)[转自 夜深人静写算法] 2,分治 3,贪心 4,排序 5,高精度 二,动态规划(重要板块) 1,线性动态规划 2,单调队列优化动态规划 3,背包型动态规划 4,区间动态规划 5,树上动态规划 6,DAG上动态
阅读全文
posted @ 2019-08-12 10:35 Hoyoak
阅读(462)
评论(0)
推荐(0)
2020年1月29日
树链剖分——重链剖分入门
该文被密码保护。
阅读全文
posted @ 2020-01-29 14:33 Hoyoak
阅读(1)
评论(0)
推荐(0)
2019年11月14日
洛谷P1125 笨小猴
摘要: 因为去年考原题了,所以再次开启了刷水之旅 #include<cstdio> #include<iostream> #include<cstring> #include<algorithm> using namespace std; char s[150]; int cnt[150],appear;
阅读全文
posted @ 2019-11-14 08:29 Hoyoak
阅读(236)
评论(0)
推荐(0)
2019年11月13日
洛谷P3174 [HAOI2009]毛毛虫
摘要: 树形DP,注意答案是节点数,我一直以为是边数懵逼了半个小时 #include<cstdio> #include<iostream> #include<cstring> #include<algorithm> #define maxn 300010 using namespace std; struc
阅读全文
posted @ 2019-11-13 09:56 Hoyoak
阅读(183)
评论(0)
推荐(0)
2019年11月12日
BZOJ3209: 花神的数论题
摘要: 重在建模QwQ,要将题意转化为 枚举1的个数k,计算有多少个数含有k个1,(因为数位dp就是来做,有多少满足的数,且不关注数的大小) 最后加个快速幂就好 #include<cstdio> #include<iostream> #include<cstring> #include<algorithm>
阅读全文
posted @ 2019-11-12 11:24 Hoyoak
阅读(133)
评论(0)
推荐(0)
P2657 [SCOI2009]windy数
摘要: 注意此类要处理前导零的数位DP题,因为如果前面全是0,这一位可以填0和1。 #include<cstdio> #include<iostream> #include<cstring> #include<algorithm> #include<cmath> using namespace std; i
阅读全文
posted @ 2019-11-12 10:19 Hoyoak
阅读(109)
评论(0)
推荐(0)
HDU3652 B-number
摘要: Description 求小于等于n的数中满足含有13且各位数字和mod13等于0的数的个数。(n<=1e9) 数位DP #include<cstdio> #include<iostream> #include<cstring> #include<algorithm> using namespace
阅读全文
posted @ 2019-11-12 09:48 Hoyoak
阅读(135)
评论(0)
推荐(0)
2019年11月11日
P1351 联合权值
摘要: 因为距离为2,所以枚举中间点即可。 #include<cstdio> #include<iostream> #include<cstring> #include<algorithm> #define maxn 200010 using namespace std; struct node { int
阅读全文
posted @ 2019-11-11 15:57 Hoyoak
阅读(163)
评论(0)
推荐(0)
洛谷P1328 生活大爆炸版石头剪刀布
摘要: 刷水QwQ 纯模拟 #include<cstdio> #include<iostream> #include<cstring> #include<algorithm> #define maxn 3000 using namespace std; int n,num_a,num_b,a[maxn],b
阅读全文
posted @ 2019-11-11 15:03 Hoyoak
阅读(159)
评论(0)
推荐(0)
洛谷P1131 [ZJOI2007]时态同步
摘要: 树形DP.. 设dp[i]表示从i到以i为根的子树的最远距离就好 转移dp[i]=max(dp[i],dp[e]+edge[i].len); 最后在遍历加一下答案就好。 记得开long long #include<cstdio> #include<iostream> #include<cstring
阅读全文
posted @ 2019-11-11 09:35 Hoyoak
阅读(187)
评论(0)
推荐(0)
洛谷P2585 [ZJOI2006]三色二叉树
摘要: 感觉方程推错了,But居然过了QwQ #include<cstdio> #include<iostream> #include<cstring> #include<algorithm> #define maxn 500010 using namespace std; struct node { in
阅读全文
posted @ 2019-11-11 08:34 Hoyoak
阅读(174)
评论(0)
推荐(0)
下一页
公告