cf/mirror

Constrained Tree

CF
513D22600· international gm2s256 MB⌨ stdin/stdout

Examples

Sample 1of 2
Input
3 2
1 2 LEFT
1 3 RIGHT
Output
2 1 3
Sample 2of 2
Input
3 2
1 2 RIGHT
1 3 LEFT
Output
IMPOSSIBLE
513D2.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)