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

建议使用的浏览器:

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

2310:Cubic Tick-Tack-Toe

题目描述
Tick-Tack-Toe is a famous simple game that is played on 3*3 grids. Two players put stones in the grids alternately and each one has his own color of stones that differ from the opponent's. The player that first gets a line of three stones vertically, horizontally, or diagonally wins the game. If the grids are all filled and no one makes a line of tree stones, the game is called a draw.

Sram Eel loves playing Tick-Tack-Toe very much. He plays it with his friend Tzxhsw every day. However, because of his weak skills, he always loses the game. Recently, he finally angers and decides to change the game to make it more interesting, that is, Cubic Tick-Tack-Toe!

Cubic Tick-Tack-Toe is played in 3*3*3 grids. Players put stones in the grids from bottom to top alternately, i.e. a stone cannot be putted in a grid, which is upon an empty grid. A player can win the game through getting one of the 49 lines of three stones. Tzxhsw is not so skilled in such a strange game, so she requests your help. To show your pure virtue, please put up your hands and knock on your keyboard!
输入解释
The input contains multiple test cases. Each test case contains 9 lines describing the current grids. A '.' denotes an empty grid, a 'O' denotes a stone put by the player taking the first turn, and a 'X' denotes a stone put by another player. The grids are described from bottom to top. Your program should estimate which player takes the next turn and analyze whether he can win the game or not.
输出解释
There is only one line for each test case. If the player taking the next turn can manage to win the game, print "WIN". If he will lose, print "LOSE". If the game will become a draw, print "DRAW".
输入样例
OXX
..O
...
XO.
...
...
OX.
...
...

OX.
...
..O
XO.
...
...
OX.
...
...
输出样例
WIN
LOSE

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

源链接: POJ-2310

最后修改于 2020-10-29T06:29:24+00:00 由爬虫自动更新

共提交 0

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