#P1917. 三子棋II
三子棋II
Description
xiaoa and uim like to practice Tic-Tac-Toe with each other. Everyone has played Tic-Tac-Toe, right? It is played on a 3×3 grid with (don't get the wrong idea), and whoever gets in a row wins.
Although xiaoa tries hard to record the games, he still cannot beat uim.
Since xiaoa is a bit slow, uim always lets him move first. xiaoa’s first move is always the center.
This time, xiaoa wants to use a tactic. The game has just started, with fewer than pieces on the board. xiaoa wants to know, given the current position, whether he has a forced win (that is, if he plays optimally, he will win no matter how the opponent plays).
Input Format
Three lines representing the board, where denotes xiaoa, denotes uim, and denotes an empty cell. It is guaranteed that the number of pieces does not exceed .
Output Format
Two lines.
On the first line, if xiaoa will win, output xiaoa will win.. If xiaoa will lose, output uim will win.. If it is unknown, output Dont know..
On the second line, output the number of pieces that have already been placed on the board.
---
-O-
---
Dont know.
1
---
-O-
-XO
xiaoa will win.
3
Hint
Translated by ChatGPT 5
京公网安备 11011102002149号