会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
1
2 3 4
Lesning
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
10
11
12
13
14
15
16
17
18
···
20
下一页
2019年12月30日
2019 沈阳网络赛 Fish eating fruit
摘要: 这题看了三个月,终于过了,第一次看的时候没学树形DP,想用点分治但是不会 后来学了二次扫描,就有点想法了。。。。 这东西也真就玄学了吧。。。 #include<iostream> #include<cstring> #include<vector> #include<algorithm> using
阅读全文
posted @ 2019-12-30 17:39 Lesning
阅读(171)
评论(0)
推荐(0)
2019年12月28日
边双连通分量还有桥
摘要: 我发现了两种边双的写法 1.先求桥,标记桥再dfs求连通块,< 似乎有点麻烦 2.直接上有向图的写法,把回头的情况标记一下 其1 int tarjan(int x, int fa) { low[x] = dfn[x] = ++df; for (int i = head[x]; i; i = G[i]
阅读全文
posted @ 2019-12-28 14:18 Lesning
阅读(153)
评论(0)
推荐(0)
牛客国庆days赛 地铁
摘要: 传送门:https://ac.nowcoder.com/acm/problem/52805 我佛了,还能跑边图啊!!! 跑边图不能用vector啦啦啦啦啦 具体也不难,就直接上代码了 #include<cstdio> #include<queue> #include<iostream> #inclu
阅读全文
posted @ 2019-12-28 10:41 Lesning
阅读(133)
评论(0)
推荐(0)
2019年12月26日
欧拉路
摘要: https://ac.nowcoder.com/acm/contest/964/B 整了个例题 一、欧拉路(能把边只走一次全走完,图还得连通) 1.无向图 (1)度数全是偶数 (2)有两个奇数度数节点(图都有偶数个奇度数节点,或者没有奇数度数节点)。 2.有向图 (1)每个点出度和入度一样 (2)出
阅读全文
posted @ 2019-12-26 19:29 Lesning
阅读(270)
评论(0)
推荐(1)
2019年12月24日
线图(边图) 极限???
摘要: 传送门: https://ac.nowcoder.com/acm/contest/3274/B 牛客练习赛题,真就特判猜结论呗 // 他没说有好几个连通块啊 1 有环(所有点度数为2),极限就是n(连通块的定点数) 2 有链子,或者单点(度数不可能大于2,) 3 特判四个顶点的菊花图。。。。输出3
阅读全文
posted @ 2019-12-24 14:53 Lesning
阅读(475)
评论(0)
推荐(0)
2019年12月16日
换根DP(二次扫描)
摘要: 参考来自这里: https://blog.csdn.net/qq_41286356/article/details/94554729 题目在这里 https://ac.nowcoder.com/acm/contest/375/C 这题真的好,算是排列组合+树形DP的结合 吧 这题换个问法就是 : 给
阅读全文
posted @ 2019-12-16 15:23 Lesning
阅读(815)
评论(0)
推荐(0)
2019年12月11日
最小生成树的计数问题
摘要: https://www.luogu.com.cn/problemnew/solution/P4208 看这里的题解就够了其实 #include<iostream> #include<cstdio> #include<cstring> #include<vector> #include<algorit
阅读全文
posted @ 2019-12-11 13:52 Lesning
阅读(146)
评论(0)
推荐(0)
2019年12月9日
倍增跑路
摘要: 数据范围,n <= 50 具体看代码吧,倍增其实就是动态规划(目前我见过的来说) #include<iostream> #include<cstring> #include<cstdio> #include<algorithm> #include<vector> using namespace st
阅读全文
posted @ 2019-12-09 21:50 Lesning
阅读(120)
评论(0)
推荐(0)
2019年12月6日
无向图最小环
摘要: LCA+最小生成树是错的 #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #include<vector> #define maxn 310 using namespace std; const lo
阅读全文
posted @ 2019-12-06 22:13 Lesning
阅读(164)
评论(0)
推荐(0)
2019年12月5日
传递纸条
摘要: 问题本质是从左上角到右下角的两条不相交路劲,权值最大 1--动态规划(二进程动态规划) 或者 网格图费用流 确定好转移状态吧 #include<iostream> #include<cstring> #include<algorithm> #include<cstdio> #define maxn
阅读全文
posted @ 2019-12-05 12:29 Lesning
阅读(194)
评论(0)
推荐(0)
上一页
1
···
10
11
12
13
14
15
16
17
18
···
20
下一页
公告