[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 122: include(/home/shoeb/public_html/www.matholympiad.org.bd/forum/includes/phpbb-latex.php) [function.include]: failed to open stream: No such file or directory
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 122: include() [function.include]: Failed opening '/home/shoeb/public_html/www.matholympiad.org.bd/forum/includes/phpbb-latex.php' for inclusion (include_path='.:/opt/php53/lib/php')
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 122: include(/home/shoeb/public_html/www.matholympiad.org.bd/forum/includes/phpbb-latex.php) [function.include]: failed to open stream: No such file or directory
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 122: include() [function.include]: Failed opening '/home/shoeb/public_html/www.matholympiad.org.bd/forum/includes/phpbb-latex.php' for inclusion (include_path='.:/opt/php53/lib/php')
[phpBB Debug] PHP Warning: in file [ROOT]/includes/session.php on line 1042: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3887)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4786: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3887)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4788: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3887)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4789: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3887)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4790: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3887)
BdMO Online Forum • View topic - BdOI 2013 National Problem 2

BdOI 2013 National Problem 2

Discuss everything related to IOI here. For more general or advanced topics use CS forum.

Moderators: bristy1588, Labib

Facebook Twitter

BdOI 2013 National Problem 2

Post Number:#1  Unread postby bristy1588 » Tue Jan 14, 2014 11:20 pm

We all know the popular game tic-tac-toe. In this game we play in a three by three grid and
put $"X" $ or $"O"$ in the cells. If the first player can put three consecutive $X's$ in a row, column or
diagonal then he wins. Same goes for the second player, only he needs to put $O's $. Given a
configuration of tic-tac-toe board, you are playing with $"X"$. Find if you can win by giving a
single move in the current board. It is guaranteed that the board is not yet won by anybody.
It is also guaranteed that, the board is a valid game position.

INPUT
First line contains $T (T < 2500)$, number of cases. Then three lines for each case. Each line
will contain three characters. These characters can be: $"X" $ (Your move), $"O" $ (Opponent
move) or $"." $(Empty cell). These three lines denote a board position.

OUTPUT
For each test case, print the test case number starting from $1$ and $"YES"$, if you can win by
giving a single move, $"NO"$, otherwise.


Sample Input
Code: Select all
3
XXO
...
OOX
X.O
OOX
..X
O..
.X.
.OX

Sample Output
Code: Select all
Case 1: YES
Case 2: NO
Case 3: NO
Bristy Sikder
User avatar
bristy1588
 
Posts: 92
Joined: Sun Jun 19, 2011 10:31 am

Share with your friends: Facebook Twitter

Return to International Olympiad in Informatics (IOI)

Who is online

Users browsing this forum: No registered users and 1 guest