下推标记法,更新区间最值,并维护一个属性------区间是否平齐,更新时把所有区间一直分解成平齐区间在决定是否修改。
感觉跑上去很慢,但实际却已经足够快,原因可能是数据弱。
#include <cstring>
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cctype>
//using namespace std;
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
#define max(a,b) ((a) > (b) ? (a) : (b))
const int maxn = 211;
const int M = 101111;
int MAX[M<<2],col[......
阅读全文