1 2 3 4
摘要: https://www.luogu.org/problemnew/solution/P4782 这里的大佬已经说的够好了 #include<iostream> #include<cstring> #include<cstdio> #include<algorithm> #include<vector 阅读全文
posted @ 2019-11-02 19:48 Lesning 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2019-10-31 21:04 Lesning 阅读(194) 评论(0) 推荐(1) 编辑
摘要: #include<cstring> #include<iostream> #include<cstdio> #include<queue> #include<algorithm> #define maxn 200200 using namespace std; typedef long long ll; int par[maxn]; ll num[maxn]; int find(int x) { 阅读全文
posted @ 2019-10-31 16:11 Lesning 阅读(573) 评论(0) 推荐(0) 编辑
摘要: 周末牛客挂了个更难的,这个简单一些 阅读全文
posted @ 2019-10-30 15:15 Lesning 阅读(233) 评论(0) 推荐(0) 编辑
摘要: 挺简单的一个dp 阅读全文
posted @ 2019-10-29 21:15 Lesning 阅读(168) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include #include #define maxn 5000100 using namespace std; typedef long long ll; ll tree[maxn]; ll arr[maxn]; int vis[maxn]; int root = 1; int push_down(int node, int... 阅读全文
posted @ 2019-10-29 14:07 Lesning 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 刚开始想了两个小时,打算把区间分块然后计算,但是这就很灵性了看了一个大佬的博客,侵删 阅读全文
posted @ 2019-10-27 19:15 Lesning 阅读(168) 评论(0) 推荐(0) 编辑
摘要: 按照《算法竞赛进阶指南》写的 哦对了,注意下最后判断,因为开始拓扑的时候,s可能不在里边,所以不一定等于INF,而是应该大于等于INF 阅读全文
posted @ 2019-10-26 15:13 Lesning 阅读(223) 评论(0) 推荐(0) 编辑
摘要: 典型树上dp,直接暴力算会超时,小心呀 阅读全文
posted @ 2019-10-26 14:32 Lesning 阅读(151) 评论(0) 推荐(0) 编辑
摘要: bfs第一次写崩了,超时到怀疑人生 阅读全文
posted @ 2019-10-24 22:14 Lesning 阅读(172) 评论(0) 推荐(0) 编辑