Words on Tree
1657F2600· international gm9s1024 MB⌨ stdin/stdout
Examples
Sample 1of 4
Input
3 22 32 12 1 ab2 3 bc
Output
YESabc
Sample 2of 4
Input
3 22 32 12 1 ab2 3 cd
Output
NO
Sample 3of 4
Input
10 101 21 31 41 51 61 71 81 91 101 2 ab1 3 ab1 4 ab1 5 ab1 6 ab1 7 ab1 8 ab1 9 ab1 10 ab10 2 aba
Output
YESbaaaaaaaaa
Sample 4of 4
Input
10 101 21 31 41 51 61 71 81 91 101 2 ab1 3 ab1 4 aa1 5 ab1 6 ab1 7 ab1 8 ab1 9 ab1 10 ab10 2 aba
Output
NO
58%
1657F.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…