cf/mirror

Palindromes in a Tree

CF
914E2400· grandmaster4s256 MB⌨ stdin/stdout

Examples

Sample 1of 2
Input
5
1 2
2 3
3 4
3 5
abcbb
Output
1 3 4 3 3
Sample 2of 2
Input
7
6 2
4 3
3 7
5 2
7 2
1 4
afefdfs
Output
1 4 1 1 2 4 2
914E.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…