![]() | ||||
Online Judge | Problem Set | Authors | Online Contests | User |
---|---|---|---|---|
Web Board Home Page F.A.Qs Announcement | Current Contest Past Contests Scheduled Contests Award Contest |
Little guys' game Time Limit:1000MS Memory Limit:65536K
Here is game played by little guys. There is a 4 * 4 square, and the
square is filled with the characters 'A', 'B', 'C' and 'D'. Each kind
of character appears exactly 4 times. You can arbitrarily swap two
adjacent characters (horizontal or vertical). At the beginning of the
game you should choose a character (from 'A', 'B', 'C' and 'D') as you
target character, when any 2 * 2 sub-square contains the same character
as the character you have chosen before, you win the game.
There are multiple test cases. Each contains a 4 * 4 square as the initial situation. Notice that the square only contains 'A', 'B', 'C' and 'D', and each kind of characters will appear exactly 4 times. Output
You should output the minimal swap times to win the game, and you
should also output how many kinds of strategies you can achieve the
minimal swap times.
POJ Monthly--2005.07.31, Huang Ninghai |
[Submit] [Go Back] [Status] [Discuss]
All Copyright Reserved 2003-2005 Ying Fuchen,Xu Pengcheng
Any problem, Please Contact Administrator