cf/mirror

Subtree Minimum Query

CF
893F2300· international master6s512 MB⌨ stdin/stdout

Examples

Sample 1of 1
Input
5 2
1 3 2 3 5
2 3
5 1
3 4
4 1
2
1 2
2 3
Output
2
5
893F.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…