1.27号英语翻译


题目来源:http://noi.openjudge.cn/ch0205/200/

重点词汇:

identical :adj.相同的;

configuration:n.构造,格局,组态,表面配置;

verify:v.验证,审核,确认;

200:Solitaire

  纸牌

  • 查看
  • 提交
  • 统计
  • 提问
总时间限制: 
5000ms
 
单个测试点时间限制: 
1000ms
 
内存限制: 
65536kB
描述
Solitaire is a game played on a chessboard 8x8. The rows and columns of the chessboard are numbered from 1 to 8, from the top to the bottom and from left to right respectively.
There are four identical pieces on the board. In one move it is allowed to:
  • move a piece to an empty neighboring field (up, down, left or right),
  • jump over one neighboring piece to an empty field (up, down, left or right).
纸牌是一种在8X8棋盘上玩的游戏。棋盘上的行列分别是从上到下,从左到右,从 1 到 8 。棋盘上有四个相同的棋子,移动一步,它可以:

  ···将一块棋子移动到相邻的空白区域(上、下、左或右),
  ···跳过相邻的一块到一个空白区域(上、下、左或右)。

There are 4 moves allowed for each piece in the configuration shown above. As an example let's consider a piece placed in the row 4, column 4. It can be moved one row up, two rows down, one column left or two columns right.
Write a program that:
  • reads two chessboard configurations from the standard input,
  • verifies whether the second one is reachable from the first one in at most 8 moves,
  • writes the result to the standard output. 

  在上面显示的配置中,每件允许 有4 次移动。 例如,让我们考虑放置在第 4 行第 4 列中的一块。它可以向上移动一行,向下移动两行,向左移动一列或向右移动两列。
  编写一个程序:
    从标准输入读取两个棋盘配置,
    验证第二个是否可以在最多 8 步内从第一个到达,
    将结果写入标准输出。

输入
Each of two input lines contains 8 integers a1, a2, ..., a8 separated by single spaces and describes one configuration of pieces on the chessboard. Integers a2j-1 and a2j (1 <= j <= 4) describe the position of one piece -- the row number and the column number respectively.
两个输入行的每一行都包含八个整数 a1,a2,.....a8  由单个空格分隔并描述棋盘上棋子的一种配置。 整数 a2j-1 和 a2j (1 <= j <= 4) 分别描述了一块的位置——行号和列号。
输出
The output should contain one word YES if a configuration described in the second input line is reachable from the configuration described in the first input line in at most 8 moves, or one word NO otherwise.
如果第二个输入行中描述的配置在最多 8 次移动中可以从第一个输入行中描述的配置到达,则输出应该包含一个单词 YES,否则输出一个单词 NO。
样例输入
4 4 4 5 5 4 6 5
2 4 3 3 3 6 4 6
样例输出
YES
来源
Southwestern Europe 2002
  • 查看
  •  
  • 提交
  •  
  • 统计
  •  
  • 提问

相关