摘要: 树套树 简介 简单来说就是两个树形数据结构的嵌套,一般是值域套区间,或者区间套区间(二维区间)。 P3380 【模板】树套树 看到查询排名与第 \(k\) 大会想到主席树,但其无法支持修改。 所以考虑树套树,外层用棵线段树表示区间,内层用一棵权值线段树表示值域。 考虑如何实现操作二,尝试二分,时间复 阅读全文
posted @ 2024-05-16 22:12 DeepSeaSpray 阅读(5) 评论(0) 推荐(0) 编辑
摘要: P3380 【模板】树套树 的代码 #include<bits/stdc++.h> using namespace std; const int maxn=5*1e4; const int maxm=500; const int inf=1e8; int n,m; int root; int a[m 阅读全文
posted @ 2024-05-16 22:12 DeepSeaSpray 阅读(1) 评论(0) 推荐(0) 编辑
摘要: P2495 [SDOI2011] 消耗战 的代码 #include<bits/stdc++.h> using namespace std; #define int long long const int maxn=5*1e5; const int maxm=20; const int inf=LLO 阅读全文
posted @ 2024-05-16 22:10 DeepSeaSpray 阅读(2) 评论(0) 推荐(0) 编辑