| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 2048 MB | 80 | 63 | 44 | 78.571% |
After you helped to save last year's Tic-Tac-Toe World Championships, you were given a grant to write a new tic-tac-toe AI to determine the best move to play.
A Tic-Tac-Toe board looks like the following. Every square can be empty, filled with an X, or filled with a O (capital letter 'o').
Player X has won if they have three X's in a row. Player O wins if they can do the same with the O's. A row can be horizontal, vertical, or diagonal.
Given the player whose turn it is, and a board where there is one winning move for that player, can you output the row and column where that player should play?
The first line of the input is either X or O, representing the player whose turn it is.
The next three lines each have 3ドル$ characters. Each of these lines represents a row on the board. Each character in a line represents a square in that row. This means you have 3ドル$ rows and 3ドル$ columns just like a normal Tic-Tac-Toe board.
Each square in the board contains either an X, O (that's a capital letter, not a number), or E. An X or O represents markings made by the players while E represents an empty square.
Input Restrictions
Output two space-separated integers representing the row and the column where the player should play. Note, the rows and columns are 1ドル$-indexed, so if the player should play in the top left corner, then you should output "1ドル$ 1ドル$".
X XXE EOO OXX
1 3
O OXX EOO OXX
2 1
School > CS@Mines > CS@Mines HSPC 2022 > Beginner G번