ADAQUBIC - Ada and TicTacToe
Ada the Ladybug was playing 3D Tic-Tac-Toe against her good friend Velvet Mite Vinit. They were playing on 3x3x3 field. Sadly, Vinit had to go home earlier so the game was left unfinished. Ada wants to know who would win the match (if they both played optimally). You also know that Ada started.
Input
The first line contains a single integer 1 ≤ T ≤ 1000, number of test-cases.
Each test-case will contain 9 lines with three character each, representing the field ('.' for empty place, 'x' for move of Ada and 'o' for move of Vinit). You are assured that the game is unfinished and valid.
First three lines represent the top field, the next three lines represent middle field and the last three lines represent the bottom field.
There will be a blank line before each test-case.
Output
For each test-case, print the name of winner (Ada or Vinit);
Example Input
7 ..o o.x xox x.x ... x.o ... o.o .x. .x. ... ..o o.x x.. ..o ..x ... ... o.. ... o.x .x. ... .x. o.o .xx oox ..x ..x .o. ..x ..x xo. o.. ..o ... ... ..x ..x .o. ..x o.. ... ... x.o ... ..x ..o ... ... xo. ox. ... .ox o.. x.. ... oxx ..o .ox ..o .x. .x.
Example Output
Vinit Vinit Ada Vinit Ada Vinit Vinit
Example Input 2
1 xox x.o oox o.o x.x xxo x.o oxo ox.
Example Output 2
Ada
hide comments
morass:
2018-11-06 17:00:08
@:D
|
|
:D:
2018-10-23 20:43:55
I assume the draw is impossible in this game variant. I didn't analyze this aspect properly.
|
|
stcsteven:
2017-09-19 02:12:29
@morass: hmm... thanks for the brief explanation man.. hahaha it is really helpful :D |
|
morass:
2017-09-19 00:22:04
@stcsteven: This one?
|
|
stcsteven:
2017-09-18 19:09:16
@morass: Woww. Thank you for the clarification hahaha... I was wandering if thy code really make it, but I guess my logic takes too long :/ . My basic idea is that making in 2d before expanding to 3d tic tac toe.
|
|
morass:
2017-09-18 18:29:33
@stcsteven: Good day to you,
|
|
stcsteven:
2017-09-18 17:07:59
Can you explain about the winning condition in this 3x3x3 tic tac toe game?
|
Added by: | Morass |
Date: | 2017-09-17 |
Time limit: | 2s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All |