Game sort numbers

Revision en1, by HaiZuka, 2021-02-08 12:21:59

Hello codeforces. Today I have a very interesting exercise, which is a number sorting game. First of all, let's understand this game.

The interface will consist of a rectangle of m rows and n columns, containing m * n squares of size 1*1. The squares will get a value from 1 to m*n-1 where no 2 cells have the same value, and 1 empty cell is numbered -1. For each step, the player is allowed to change the position of the empty cell (_containing the number -1_) for the adjacent cells. The game will be over if the tiles are in place, an empty cell (bearing number -1) is at the bottom right corner, the remaining numbers are arranged in ascending order from left to right, top to bottom. The figure below is an example of the ending game:

Tags #algorithms, #training

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en5 English HaiZuka 2021-02-08 13:06:28 3 Tiny change: 'a start.\n![ ](htt' -> 'a start.\n\n![ ](htt'
en4 English HaiZuka 2021-02-08 13:05:13 714 Tiny change: '----\n####Input:\n####2 3 \n' -> '----\n######Input:\n######2 3 \n' (published)
en3 English HaiZuka 2021-02-08 12:51:50 593
en2 English HaiZuka 2021-02-08 12:41:51 413 Tiny change: '](https://ibb.co/8jJQ9v7)' -> '](https://www.upsieutoc.com/images/2021/02/08/a.png)'
en1 English HaiZuka 2021-02-08 12:21:59 831 Initial revision (saved to drafts)