编程介的小学生 2019-10-03 20:02 采纳率: 20.5%
浏览 72

Chapayev 编写的程序

Description

Legendary divisional commander Vasiliy I. Chapayev was fond of playing this beautiful game with his aide-de-camp Pete during their (scanty) spare time. The game is played as follows. There are eight white and eight red draughts on the board at the beginning of the game. The red side starts the game by making the first turn. The turn consists of selecting an arbitrary draught of player's colour and pushing it with a flick into a certain direction. Then this draught begins to move in this direction until it completely falls off the board. If it hits or even just touches another draught of any colour during the movement, the latter is immediately removed from the board being considered killed. In any case the moving draught continues its movement without changing its speed or direction. After the moving draught has completed its movement across the board (has fallen off) the other player has to make his turn. If there are no draughts of player's colour left he is considered to lose the game.

The historians have a record of an initial position in one of such games. Unfortunately, the result of this game is unknown. Your task is to establish the truth taking for granted that both Chapayev and Pete always used the optimal strategy.
Input

Each of two lines of the input file contains eight pairs of numbers --the coordinates of centres of red and white draughts respectively. The draughts are considered to be cylinders of radius 0.4 and height 0.15. The coordinates are calculated so that the board is a square 8x8 with vertices (0, 0), (0, 8), (8, 0) and (8, 8). There will be no draught that overlaps or touches another one. Also each piece in the initial position is completely contained within the limits of the board.
Output

The first line of the output file should contain RED or WHITE corresponding to the winning side.
Sample Input

0.5 7.5 1.5 7.5 2.5 7.5 3.5 7.5 4.5 7.5 5.5 7.5 6.5 7.5 7.5 7.5
0.5 0.5 1.5 0.5 2.5 0.5 3.5 0.5 4.5 0.5 5.5 0.5 6.5 0.5 7.5 0.5
Sample Output

RED

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 flink cdc无法实时同步mysql数据
    • ¥100 有人会搭建GPT-J-6B框架吗?有偿
    • ¥15 求差集那个函数有问题,有无佬可以解决
    • ¥15 【提问】基于Invest的水源涵养
    • ¥20 微信网友居然可以通过vx号找到我绑的手机号
    • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
    • ¥15 解riccati方程组
    • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
    • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
    • ¥50 树莓派安卓APK系统签名