随笔 - 530
文章 - 0
评论 - 3
阅读 -
10098
06 2023 档案
1~n 线段覆盖
摘要:void solve(){ int r=a[1].r; int i=2, mx=0, ans=1; while(r<len){ mx=r; while(a[i].l<=r&&i<=len){ mx=max(mx,a[i].r); i++; } ans++ ; r=mx; } cout<<ans-1<
阅读全文
manacher 记录
摘要:首先注意 2* n 的长度 mx: 当前匹配到的最大长度 即 [1,mx] id: mx 对应的中心点 pi : s[i] 为中心的回文串的最大长度, pi /2 -1 是半径() #include <iostream> #include <cstring> #include <algorithm>
阅读全文
LIS (数据结构优化dp
摘要:首先是代码量小的bit 值域上建立bit, 需要注意合并类型应该有单调性 https://www.luogu.com.cn/problem/AT_dp_q https://www.luogu.com.cn/record/133869096 线段树 值域上建立线段树,区间查询,单点改 #include
阅读全文
静态区间第k小
摘要:可持久化线段树 #include <cstdio> #include <algorithm> using namespace std ; const int maxn=200010; int a[maxn],b[maxn],blen,n,CNT; int sum[maxn<<5],lc[maxn<<
阅读全文
P4556 [Vani有约会]雨天的尾巴 /【模板】线段树合并
摘要:线段树合并板子 #include<iostream> #include<cstring> using namespace std; const int N =5e5+10,M =N*2; int nxt[M],hd[N],all=1,go[M],n,m; int dep[N],f[N][22],fa
阅读全文