其他分享
首页 > 其他分享> > 第十七篇英语翻译

第十七篇英语翻译

作者:互联网

重点单词:

piece n.个,块,片,零件,部分,点;

verify v.核实,查证,证明;

configuration n.布局,构造,配置;

identical adj.完全相同的,同一的;

出处:https://acs.jxnu.edu.cn/problem/NOIOPJCH0205200

Solitaire

 5000ms  1000K

描述:

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. 跳棋是一个在8*8的棋盘上玩的游戏。在棋盘上,每一行,每一列都分别从左到右,从上到下被标上了0--8的数字序号。

There are four identical pieces on the board. In one move it is allowed to: 棋盘上有四块完全相同的棋子。在一步移动中它允许作如下操作:



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:

在上面所示的配置中,每个棋子允许上述4种移动。作为一个例子,让我们考虑放置在行4、列4中的一个片段。它可以向上移动一行、向下移动两行、向左移动一列或向右移动两列。

编写一个程序:



输入:

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.

输出:

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.

样例输入:

4 4 4 5 5 4 6 5
2 4 3 3 3 6 4 6

样例输出:

YES

注释:

Source: Southwestern Europe 2002

标签:棋盘,英语翻译,piece,第十七,right,configuration,input,移动
来源: https://www.cnblogs.com/cilinmengye/p/15881510.html