CF38B.Chess
普及-
通过率:0%
时间限制:2.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Two chess pieces, a rook and a knight, stand on a standard chessboard 8 × 8 in size. The positions in which they are situated are known. It is guaranteed that none of them beats the other one.
Your task is to find the number of ways to place another knight on the board so that none of the three pieces on the board beat another one. A new piece can only be placed on an empty square.
两个国际象棋棋子——一个车(rook)和一个马(knight)——位于标准的 8×8 棋盘上,它们的位置已知。保证二者互不攻击。
你的任务是:求出在棋盘上再放置一个马的方案数,使得棋盘上的三个棋子两两之间均互不攻击。新棋子只能放在空格上。
输入格式
The first input line contains the description of the rook's position on the board. This description is a line which is 2 in length. Its first symbol is a lower-case Latin letter from a to h, and its second symbol is a number from 1 to 8. The second line contains the description of the knight's position in a similar way. It is guaranteed that their positions do not coincide.
第一行输入描述了车在棋盘上的位置。该描述是一行长度为 2 的字符串:第一个字符是小写拉丁字母 a 到 h 中的一个,第二个字符是数字 1 到 8 中的一个。第二行以类似方式描述了马的位置。保证两者的坐标不重合。
输出格式
Print a single number which is the required number of ways.
输出一个数字,即所需的方案数。
输入输出样例
输入#1
a1 b2
输出#1
44
输入#2
a8 d4
输出#2
38
输入解题思路,AI测评打分。不知道怎么写?