Skip to content
User Avatar
#986
Auto-translated
You can create a graph where each vertex corresponds to a specific arrangement of the tiles. :) There will be a total of 6*5! = 720 vertices. Connect the vertices with edges representing possible transitions from one state of the board to another, and calculate the shortest paths from the state shown in the image to all possible states where the tile '4' is above the tile '5' in the rightmost row. :D The shortest of these paths will be the answer.
Всё не так плохо как Вы думаете. Всё намного хуже!