当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

3551:Putin-chess

Special Judge 特殊评判
题目描述

Visitors of the site dni.ru are offered to play "Putin-chess" – a game that is a combination of chess and the well-known computer game "Lines". Here is a simplified version of the game.

There are several chess pieces (except pawns) on a standard chessboard. They are placed disregarding the usual chess rules, but each square may contain no more than one piece. A player can make a standard chess move with any piece (of any color) to any free square. The object is to align five or more pieces of the same color side by side in a vertical, horizontal or diagonal line. Several lines can be formed with one move. After the move, all pieces in all formed lines are removed from the board. Moves not resulting in line formation are not allowed. The game goes on until the player cannot move.

The task is to determine maximal number of pieces that can be removed from the board according to these rules.

输入解释

The first line contains the number of white and black pieces. The numbers are separated by one or more spaces. Each following line contains the description of one piece (upper-case Latin letters R, Q, K, B, C for king "rex", queen, knight, bishop, or castle) and the initial location of the piece in the standard chess notation (the lower left-hand square has notation a1, the upper right-hand – h8). At first the white pieces are described, then the black ones. It is guaranteed that the initial configuration contains no lines that could be removed.

输出解释

The first line contains two numbers: the number of pieces removed and the number of moves. The numbers should be separated by one or more spaces. Each following line describes one move. It contains the description of a piece (in the same format as in the input file), the character '‑' and the notation of the square to which the piece is moved.

If the task has several solutions it is sufficient to give only one of them.

输入样例
5 0
Rb1
Kc1
Ke3
Re1
Rf1
输出样例
5 1
Ke3-d1

该题目是Virtual Judge题目,来自 北京大学POJ

源链接: POJ-3551

最后修改于 2020-10-29T07:04:21+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
1000 65536