分块莫队
摘要:#分块 ##分块分的形式灵活,每一个块里可以是很多东西 ###eg:https://www.luogu.com.cn/problem/CF455D ####需要灵活维护位置的移动,用双端队列就可以搞定。但是细节比较多,【1】同一块和多块的查询/修改是要分开讨论【2】注意及时pop掉元素 点击查看代码
阅读全文
posted @
2022-04-14 10:32
HZOI-曹蓉
阅读(16)
推荐(0) 编辑
状态压缩DP
摘要:/*炮兵阵地*/const int N=200; int no[N],can[100+10],num[100+10],n,m; int f[N][1000][1000];//10^8 char s[20];int maxn,cnt; inline int lowbit(int x) { return
阅读全文
posted @
2022-04-09 15:06
HZOI-曹蓉
阅读(16)
推荐(0) 编辑
线段树合并,权值线段树
摘要:#include<iostream> #include<cstring> #include<cmath> #include<cstdio> #include<cstdlib> #include<ctime> #include<algorithm> #include<iomanip> #include
阅读全文
posted @
2022-04-04 15:12
HZOI-曹蓉
阅读(19)
推荐(0) 编辑