CF754B Ilya and tic-tac-toe game
题目描述
题目大意:
伊莉雅是一个4x4井字棋的年迈棋手,他总是用x(英文小写)棋,今天,他跟他的朋友亚瑟玩了很多很多局游戏,亚瑟很累了,但是现在还剩下最后一场游戏,现在轮到伊莉雅下棋,请问伊莉雅下完这颗棋子后能否取得胜利?
井字棋规则:
棋盘的规格为4*4,其中伊莉雅棋子为x,亚瑟的棋子为o(英文小写o),x先下,o后下,当某种棋子在棋盘上连成三个时取得胜利!(这三个棋子可以是水平、竖直或斜方向的连续三个)
输入格式
输入的数据为给定的棋盘,其中.为空格,x(英文小写)为伊莉雅的棋子, o(英文小写)为亚瑟的棋子,棋盘保证有空格子,现在轮到伊莉雅。 (有可能整个棋盘都没有棋子,意味着亚瑟还没有下)
输出格式
输出为单行:如果伊莉雅下完一颗棋子后能够取得胜利,输出YES,如果不能,则输出NO。
感谢@icebird 提供的翻译
说明/提示
In the first example Ilya had two winning moves: to the empty cell in the left column and to the leftmost empty cell in the first row.
In the second example it wasn't possible to win by making single turn.
In the third example Ilya could have won by placing X in the last row between two existing Xs.
In the fourth example it wasn't possible to win by making single turn.