#P8233. [AGM 2022 资格赛] 区间
[AGM 2022 资格赛] 区间
Problem Description
You are given an infinite one-dimensional row of grid cells. At the beginning, every cell is white.
You need to maintain the following two operations:
-
1 l r: Paint every cell from to black. -
2 l r: Query how many sub-intervals in have all cells in the interval painted black.
Input Format
The first line contains an integer , which denotes the number of operations.
The next lines each contain three numbers , which denote the operation type and the interval.
Output Format
For each operation of type , output one line containing an integer, which is the answer modulo .
4
1 2 2
2 1 5
1 3 5
2 1 5
1
10
Hint
Constraints
For of the testdata, it is guaranteed that , , .
Notes
Translated from AGM 2022 Qualification Round E Intervals。
Translated by ChatGPT 5