题意很是晦涩。
大意为:给出一个01串,有三种操作:
1.把区间[a, b]内的数全变为1;
2.把区间[a, b]内的数全变为0;
3.把区间[a, b]内的数全部取反。
基础的延迟更新操作。
关于离线操作,区间最好处理成左闭右开,否则对于[x0, x1]和[x1, x2]中的x1不好处理。
#include <algorithm>
#include <iostream>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <math.h>
using namespace std;
#define MAXN 1024010
#define lson l, m, rt << 1
#define rson m + 1......
阅读全文