Location:
Search - poj2814
Search list
Description: Time Limit: 1000ms
Memory limit: 65536kB
题目描述
有9个时钟,排成一个3*3的矩阵。
现在需要用最少的移动,将9个时钟的指针都拨到12点的位置。共允许有9种不同的移动。如右表所示,每个移动会将若干个时钟的指针沿顺时针方向拨动90度。
移动 影响的时钟
1 ABDE
2 ABC
3 BCEF
4 ADG
5 BDEFH
6 CFI
7 DEGH
8 GHI
9 EFHI
(图 2)
输入
从标准输入设备读入9个整数,表示各时钟指针的起始位置。1=12点、1=3点、2=6点、3=9点。
输出
输出一个最短的移动序列,使得9个时钟的指针都指向12点。按照移动的序号大小,输出结果-Time Limit: 1000ms Memory limit: 65536kB subject described in 9 clock, arranged in a 3* 3 matrix. Now need to move with the least, will have nine clock pointer Slide 12 o' clock. Allowed a total of 9 different mobile. Like right in the table below, each move will be a number of pointer clock toggle 90 degrees clockwise. Effects of clock movement 1 ABDE 2 ABC 3 BCEF 4 ADG 5 BDEFH 6 CFI 7 DEGH 8 GHI 9 EFHI (Figure 2) input from the standard input device 9 reads an integer, said the starting position of the clock pointer. 1 = 12 points, 1 = 3 points, 2 = 6 points, 3 = 9 points. Output Output a shortest movement sequence, making nine clock pointers all point to 12 points. According to the size of mobile serial number, output
Platform: |
Size: 1024 |
Author: jing |
Hits: