cf/mirror

Yunli's Subarray Queries (extreme version)

CF
2009G32700· international gm3s512 MB⌨ stdin/stdout

Examples

Sample 1of 1
Input
5
7 2 4
1 2 3 2 1 2 3
4 6
1 7
2 7
3 7
8 4 2
4 3 1 1 2 4 3 2
3 6
1 5
5 4 2
4 5 1 2 3
1 4
1 5
10 4 8
2 3 6 5 8 9 8 10 10 1
2 7
6 10
1 9
1 6
3 9
4 10
2 10
1 8
10 7 4
3 4 5 3 4 5 9 10 8 9
1 9
2 10
1 10
2 9
Output
1
3
3
3
2
7
2
4
8
6
28
7
16
20
32
19
18
15
26
9
2009G3.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)