Pro.ID21737 TitleCrosses and Crosses Title链接http://10.20.2.8/oj/exercise/problem?problem_id=21737 AC0 Submit0 Ratio- 时间&空间限制描述The game of Crosses and Crosses is played on the field of 1×n cells. Two players make moves in turn. Each move the player selects any free cell on the field and puts a cross '×' to it. If after the player's move there are three crosses in a row, he wins and the game stops. You are given a position in the game. Find out, who has won the game. 输入The input file contains one line containing only characters '×' (ASCII code 120) denoting crosses and '.' (ASCII code 46) denoting empty cells. The number of cells in the given position does not exceed 30. 输出Description The game of Crosses and Crosses is played on the field of 1×n cells. Two players make moves in turn. Each move the player selects any free cell on the field and puts a cross '×' to it. If after the player's move there are three crosses in a row, he wins and the game stops. You are given a position in the game. Find out, who has won the game. Input The input file contains one line containing only characters '×' (ASCII code 120) denoting crosses and '.' (ASCII code 46) denoting empty cells. The number of cells in the given position does not exceed 30. Output The first line of output file should contain one of the following strings: "First", if the first player has won the game; "Second", if the second player has won the game; "Nobody", if nobody has won yet; "Invalid", if the position is invalid, i.e. it could not have been reached in a correctly played game. Sample Input Sample #1 x.xxx.x Sample #2 xxxxxxxx Sample Output Sample #1 First Sample #2 Invalid Source 样例输入Sample #1 x.xxx.x Sample #2 xxxxxxxx 样例输出Sample #1 First Sample #2 Invalid 作者 |