摘要:
树状数组基础模板 树状数组,顾名思义就是用树的结构来存储数据,树状数组支持的操作有区间修改和区间查询(单点也是可以),具体原理不再解释。 一维树状数组模板 点击查看代码 const int N=; int c[N];//树状数组 int n; int a[N];//存储数组 int lowbit(i 阅读全文
摘要:
坐标DP相较来说会比较简单。 直接上例题 1.坐标遍历问题 传纸条 点击查看代码 #include<bits/stdc++.h> using namespace std; const int N=120; int m,n; int g[N][N],f[N][N][N]; int ans; int m 阅读全文
摘要:
这篇主要涉及线性DP。 先介绍模型,求最长上升子序列。 点击查看代码 #include <bits/stdc++.h> using namespace std; const int N=1020; int n; int f[N],ans,a[N]; int pre[N],te; void outpu 阅读全文