![]() ![]() Write a program that finds the minimum number of moves required to rearrange the tanks so that each row and each column contains a single tank, and one such shortest sequence of moves. However, they want to do this using the minimum number of moves. The tank is said to be guarding the row and column it is in.Īdditionally, no two tanks can be in the same square at any time.Īfter many hours of play and two previous attempts, Mirko's mom yelled at them to come down for lunch again, and they decided to rearrange the tanks so that each tank guards a different row and column (meaning also that each row and column contains only one tank). A tank can shoot at any square in the same row and column. They made a battlefield – a wooden board consisting of squares in N N rows and N N columns.Įach tank can be moved to one of the four neighbouring squares in a single move. He promptly called his friend Slavko to play with him. ![]() ![]() Mirko found a collection of N N toy tanks dating back to the Second World War on his grandfather's attic. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |