Hot Search : Source embeded web remote control p2p game More...
Location : Home Search - light off
Search - light off - List
求解关灯游戏。  手机上的游戏:有n×m个格子代表n×m个房间,每个房间有一盏灯和一个奇怪的开关,这个开关可以同时控制本房间和上下左右四个房间的灯,但是每次只能同时变换状态,把开的关掉,关的开启。现在有若干个房间的灯开着,问如何使用这些开关关掉所有灯。   注意到灯的状态跟开关数量有关,但是跟开关使用的次序没有关系,而且某个开关使用两次跟没有使用的效果相同,也就是说n×m个房间最多需要使用n×m次开关就能够把所有灯关掉,每个开关最多使用一次。 -Solving the lights game. Mobile phone game: an n × m grid on behalf of an n × m rooms, each room has a light and a strange switch, this switch can also control the lights of the room and four rooms up and down, but each time only can change state, turn off the open, related to open. There are a number of room lights on, and asked how to use these to switch off all lights. Noting that the light of the state with the number of switches, but with the switch to use the order does not matter, and a switch is used twice with the same effect as not using, that is the n × m, a room need to use up to n × m switch all the lights to turn off each switch up to be used once.
Date : 2025-12-29 Size : 171kb User : sunjunyu
CodeBus is one of the largest source code repositories on the Internet!
Contact us :
1999-2046 CodeBus All Rights Reserved.