摘要: 思路十分显然,但是结构体的写法要注意. 定义重载运算符可以有效地减小代码量. 因为一个小错误调了半天,自闭了. code: #include <map> #include <cstdio> #define mod 998244353 #define setIO(s) freopen(s".in"," 阅读全文
posted @ 2020-06-01 22:01 EM-LGH 阅读(189) 评论(0) 推荐(0) 编辑
摘要: 以前总是不愿意写平衡树,这次规范了一下写法. 1. 建立虚拟节点 -inf 与 inf 2. 每隔 10 次左右 splay 到根 3. 各种操作写递归版就行. code: #include <cstdio> #include <algorithm> #include <cstring> #incl 阅读全文
posted @ 2020-06-01 16:42 EM-LGH 阅读(216) 评论(0) 推荐(0) 编辑
摘要: 如果进行了 $q$ 个操作,且这 $q$ 个操作都包含位置 $i$,则 $i$ 位置的值一定是最大值. 所以我们就可以按照区间进行线段树分治,然后拿 bitset 优化一下 $dp$ 即可. code: #include <bits/stdc++.h> #define N 10008 #define 阅读全文
posted @ 2020-06-01 08:37 EM-LGH 阅读(148) 评论(0) 推荐(0) 编辑