Skip to content
User Avatar
#1015
Auto-translated
Hermit
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 field to another, and calculate the shortest paths from the state shown in the picture to all possible states where there are 4 tiles above 5 in the right row. :D The shortest one will be the answer.
Ment
You've become quite the expert, sir. However, I'd be happy to watch. :D
No problem!
http://www.hermit.besaba.com/project1.ex-
Where 10000 means there is no path.

Added 1 minute ago
I apologize for the not-so-beautiful and convenient presentation; I just did it in a terrible hurry to unlock the topic.
Всё не так плохо как Вы думаете. Всё намного хуже!