[UVA][bfs] 11198 - Dancing Digits
Problem D
Dancing Digits
Digits like to dance. One day, 1, 2, 3, 4, 5, 6, 7 and 8 stand in a
line to have a wonderful party. Each time, a male digit can ask a female
digit to dance with him, or a female digit can ask a male digit to
dance with her, as long as their ...