Polycarp and Snakes
1185E2000· candidate master4s256 MB⌨ stdin/stdout
Examples
Sample 1of 3
Input
15 6...a....bbb....a...cccc....a..
Output
YES31 4 5 42 3 2 54 2 4 5
Sample 2of 3
Input
33 3.........4 4..c.addabbcb....3 5..b..aaaaa..b..
Output
YES0YES42 1 2 43 1 3 41 3 3 32 2 2 3NO
Sample 3of 3
Input
23 3....a....2 2bbcc
Output
YES12 2 2 2YES31 1 1 21 1 1 22 1 2 2
58%
1185E.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)