ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

第十七篇英语翻译

2022-02-10 23:36:13  阅读:244  来源: 互联网

标签:棋盘 英语翻译 piece 第十七 right configuration input 移动


重点单词:

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: 棋盘上有四块完全相同的棋子。在一步移动中它允许作如下操作:

  • 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).
  • 跳过相邻的棋子到空棋盘点;


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中的一个片段。它可以向上移动一行、向下移动两行、向左移动一列或向右移动两列。

编写一个程序:



  • 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.
  • 从标准输入读取两个棋盘配置,

  •  

    验证在最多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.

输出:

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

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有