BZOJ3339: Rmq Problem

Time Limit: 20 Sec  Memory Limit: 128 MB

Description

Input

Output

Sample Input

7 5
0 2 1 0 1 3 2
1 3
2 3
1 4
3 6
2 7

Sample Output

3
0
3
2
4

HINT

Source

By Xhr

Solution

莫队。

 

点赞

发表评论

您的电子邮箱地址不会被公开。