cf/mirror

Alyona and a tree

CF
739B1900· candidate master2s256 MB⌨ stdin/stdout

Examples

Sample 1of 2
Input
5
2 5 1 4 6
1 7
1 1
3 5
3 6
Output
1 0 1 0 0
Sample 2of 2
Input
5
9 7 8 6 5
1 1
2 1
3 1
4 1
Output
4 3 2 1 0
739B.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…