
线段树
hbulzh
这个作者很懒,什么都没留下…
展开
-
牛客网 柠檬树
https://ac.nowcoder.com/acm/problem/212478线段树 维护区间最近公共祖先树状数组维护颜色信息前缀和lct动态加点维护集合信息然后对查询按右端点排序,离线查询,最后输出#include <bits/stdc++.h>using namespace std;const int N = 1e6+10;int h[N], e[N], nxt[N], idx;int t[N], dep[N], fa[N][20];int c[N],原创 2021-07-10 09:11:01 · 167 阅读 · 0 评论 -
CCF CSP 2019-12-05 魔数
BFS搜出所有转移状态 然后+线段树+懒标记+__int128乘法运算+ 动态规划优化build函数的节点初始化少了任何一个优化都过不去一个优化都不少也有可能过不去,时间卡的太极限了,可能还有极致的优化...#include <bits/stdc++.h> #define ull unsigned long longusing namespace std;const ull mod = 2009731336725594113;const int N = 1e6+10;u原创 2020-08-13 15:44:15 · 839 阅读 · 1 评论