cf/mirror

Balanced Tree

CF
2062D2200· master3s512 MB⌨ stdin/stdout

Examples

Sample 1of 1multi-test • hover to link
Input
6
4
0 11
6 6
0 0
5 5
2 1
3 1
4 3
7
1 1
0 5
0 5
2 2
2 2
2 2
2 2
1 2
1 3
2 4
2 5
3 6
3 7
4
1 1
1 1
1 1
0 0
1 4
2 4
3 4
7
0 20
0 20
0 20
0 20
3 3
4 4
5 5
1 2
1 3
1 4
2 5
3 6
4 7
5
1000000000 1000000000
0 0
1000000000 1000000000
0 0
1000000000 1000000000
3 2
2 1
1 4
4 5
6
21 88
57 81
98 99
61 76
15 50
23 67
2 1
3 2
4 3
5 3
6 4
Output
11
3
3
5
3000000000
98
2062D.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…