1 2 3 4
上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 20 下一页
摘要: 这个差分约束真的想不到,说白了就是统计C和D https://www.luogu.com.cn/problem/P2474 哎不说了,建议看看原来的题解 #include<iostream> #include<cstring> #include<algorithm> #include<cstdio> 阅读全文
posted @ 2020-03-21 18:24 Lesning 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 2-SAT快忘了,回忆了一下 x >y 代表选择x必选择y #include<iostream> #include<algorithm> #include<cstring> #include<stack> #include<cstdio> using namespace std; const int 阅读全文
posted @ 2020-03-19 18:48 Lesning 阅读(108) 评论(0) 推荐(0) 编辑
摘要: https://www.luogu.com.cn/problem/P4438 这个神仙问题告诉我们,树形dp还是dp,动态规划是真的难,不会设转移方程要吃大亏 写成记忆话搜索是真的方便,服了 #include<iostream> #include<cstring> #include<cstdio> 阅读全文
posted @ 2020-03-18 19:20 Lesning 阅读(139) 评论(0) 推荐(0) 编辑
摘要: https://www.luogu.com.cn/problem/P1772 这是一个非常神奇的动态规划+最短路问题 #include<iostream> #include<cstring> #include<queue> #include<vector> using namespace std; 阅读全文
posted @ 2020-03-14 20:10 Lesning 阅读(87) 评论(0) 推荐(0) 编辑
摘要: 差分约束问题(判定负环) #include<iostream> #include<cstring> #include<cstdio> #include<algorithm> #include<queue> using namespace std; const int INF = 1e9; const 阅读全文
posted @ 2020-03-12 18:38 Lesning 阅读(105) 评论(0) 推荐(0) 编辑
摘要: 这题没啥可说的,就是线段树题, #include<cstring> #include<vector> #include<iostream> #include<algorithm> #include<cstdio> using namespace std; typedef long long ll; 阅读全文
posted @ 2020-03-11 23:31 Lesning 阅读(156) 评论(0) 推荐(0) 编辑
摘要: 贪心+树形dp 尽可能低价买入,高价卖出 设好转移规律就好了 长记性 dp[i][1] i号节点或者他的某个子孙中最低买入价格//要靠考虑路费 dp[i][0] i号节点或者他的某个子孙中最高卖出价格//要考虑路费 #include<iostream> #include<cstring> #incl 阅读全文
posted @ 2020-03-09 23:57 Lesning 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 这题简直树链剖分板子题。。。。真没啥可说的。当时不懂树剖,可惜啦 #include<cstring> #include<iostream> #include<algorithm> #include<queue> using namespace std; typedef long long ll; c 阅读全文
posted @ 2020-03-06 18:50 Lesning 阅读(97) 评论(0) 推荐(0) 编辑
摘要: 很神仙的题 https://www.luogu.com.cn/problem/P2486 大致如下图,我感觉本质还是数据结构线段树。 #include<cstring> #include<cstdio> #include<iostream> #include<algorithm> #include< 阅读全文
posted @ 2020-03-04 01:36 Lesning 阅读(110) 评论(0) 推荐(0) 编辑
摘要: 我感觉就是线段树+LCA的思想了 核心还是线段树 需要注意 在标记中,一个节点的所有子孙一定都是标号小于该节点的。 https://www.luogu.com.cn/problem/P2590 洛谷例题 解答 功能变多了就会很长很长 #include<cstring> #include<cstdio 阅读全文
posted @ 2020-02-29 19:16 Lesning 阅读(120) 评论(0) 推荐(0) 编辑
上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 20 下一页