Hot Search : Source embeded web remote control p2p game More...
Location : Home Search - coin calculation
Search - coin calculation - List
有 m × n(m ≤ 100 ,n ≤ 100) 个金币在桌面上排成一个 m行 n列的金币阵列。 每一枚金币或正面朝上或背面朝上。用数字表示金币状态, 0表示金币正面朝上, 1表示背面朝上。 金币阵列游戏的规则是: (1)每次可将任一行金币翻过来放在原来的位置上; (2)每次可任选 2列,交换这 2列金币的位置。 .编程任务: 给定金币阵列的初始状态和目标状态,编程计算按金币游戏规则,将金币阵列从初始状 态变换到目标状态所需的最少变换次数。 -A m × n (m ≤ 100, n ≤ 100) gold coins on the table arranged in a m-n array of gold coins. Each gold coin or face up or back up. Gold status with the digits, 0 gold side up, 1 back up. Gold arrays rules of the game are: (1) gold coins each time to turn over any line on the original location (2) choice of two each time, switching the location of these two gold coins. . Programming tasks: Given the array of initial state and the gold target state, programming calculation rules of the game by gold, the gold transform the array to the target from the initial state the minimum required to change the number of states.
Date : 2025-12-19 Size : 906kb User : 刘燕
CodeBus is one of the largest source code repositories on the Internet!
Contact us :
1999-2046 CodeBus All Rights Reserved.