题目描述
You are given a string $S$ of length $N$ consisting of `0` and `1`. Let $S_i$ denote the $i$\-th character of $S$.
Process $Q$ queries in the order they are given.
Each query is represented by a tuple of three integers $(c, L, R)$, where $c$ represents the type of the query.
- When $c=1$: For each integer $i$ such that $L \leq i \leq R$, if $S_i$ is `1`, change it to `0`; if it is `0`, change it to `1`.
- When $c=2$: Let $T$ be the string obtained by extracting the $L$\-th through $R$\-th characters of $S$. Print the maximum number of consecutive `1`s in $T$.
### Constraints
- $1 \leq N \leq 5 \times 10^5$
- $1 \leq Q \leq 10^5$
- $S$ is a string of length $N$ consisting of `0` and `1`.
- $c \in \lbrace 1, 2 \rbrace$
- $1 \leq L \leq R \leq N$
- $N$, $Q$, $c$, $L$, and $R$ are all integers.
输入格式
The input is given from Standard Input in the following format, where $\mathrm{query}_i$ represents the $i$\-th query:
$N$ $Q$
$S$
$\mathrm{query}_1$
$\mathrm{query}_2$
$\vdots$
$\mathrm{query}_Q$
Each query is given in the following format:
$c$ $L$ $R$
输出格式
Let $k$ be the number of queries with $c=2$. Print $k$ lines.
The $i$\-th line should contain the answer to the $i$\-th query with $c=2$.
样例输入 #1
7 6 1101110 2 1 7 2 2 4 1 3 6 2 5 6 1 4 7 2 1 7
样例输出 #1
3 1 0 7