摘要: 题意 "题目链接" Sol $f[i][j]$表示前$i$行$j$列的贡献,转移的时候枚举从哪里转移而来,复杂度$O(n^4)$ 然后考虑每一行的贡献,动态开节点线段树维护一下每种颜色的答案 转移的时候用总的方案减去相同颜色的方案 复杂度$O(n^2 log^2 n)$ cpp include de 阅读全文
posted @ 2019-01-03 18:47 自为风月马前卒 阅读(329) 评论(0) 推荐(0) 编辑
摘要: 题意 "题目链接" Sol 直接上动态开节点线段树 因为只有一次询问,所以中途不需要下传标记 cpp include define LL long long using namespace std; const int MAXN = 8e6 + 10, INF = 1e9 + 10; templat 阅读全文
posted @ 2019-01-03 16:44 自为风月马前卒 阅读(292) 评论(0) 推荐(0) 编辑
摘要: 题意 "题目链接" Sol 一个显然的思路是维护最大最小值以及最大最小值的覆盖标记。 https://paste.ubuntu.com/p/WXpBvzF6Y2/ 但实际上因为这题只需要输出最后的操作序列,那么我们只维护最大最小值的覆盖标记即可。 也就是对于每一个节点,把本层的最大最小值下传之后清除 阅读全文
posted @ 2019-01-03 15:30 自为风月马前卒 阅读(254) 评论(0) 推荐(0) 编辑
摘要: 题意 "题目链接" Sol 严格众数只会出现一次,那么建出主席树,维护子树siz,直接在树上二分即可 cpp include define LL long long using namespace std; const int MAXN = 2e6 + 10; inline int read() { 阅读全文
posted @ 2019-01-03 11:45 自为风月马前卒 阅读(232) 评论(0) 推荐(0) 编辑
摘要: 题意 "题目链接" Sol 单调栈板子题。。 找到向左第一个比他大的位置,然后判断一下就可以了 cpp include // define int long long define LL long long using namespace std; const int MAXN = 1e6 + 10 阅读全文
posted @ 2019-01-03 09:05 自为风月马前卒 阅读(105) 评论(0) 推荐(0) 编辑
摘要: 题意 "题目链接" Sol 二维数点板子题 首先把询问拆成四个矩形 然后离散化+树状数组统计就可以了 cpp // luogu judger enable o2 include define LL long long using namespace std; const int MAXN = 4e6 阅读全文
posted @ 2019-01-03 09:03 自为风月马前卒 阅读(369) 评论(0) 推荐(0) 编辑

Contact with me