Alphabetic Tree
1608G3500· legendary gm3s256 MB⌨ stdin/stdout
Examples
Sample 1of 2
Input
2 5 31 2 aaabababaaaba2 1 1 51 2 1 32 1 3 5
Output
874
Sample 2of 2
Input
9 5 61 2 a2 7 c1 3 b3 4 b4 6 b3 5 a5 8 b5 9 cababacabbbbacbbbacabacaba2 7 1 42 5 1 56 3 4 46 9 4 55 7 3 55 3 1 5
Output
3421110
58%
1608G.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…