|
Time |
Memory |
| Case 1 |
1 sec |
32 MB |
| Case 2 |
1 sec |
32 MB |
| Case 3 |
1 sec |
32 MB |
| Case 4 |
1 sec |
32 MB |
| Case 5 |
1 sec |
32 MB |
| Case 6 |
1 sec |
32 MB |
| Case 7 |
1 sec |
32 MB |
| Case 8 |
1 sec |
32 MB |
| Case 9 |
1 sec |
32 MB |
| Case 10 |
1 sec |
32 MB |
Description
Your program requires the following features:
- Receive a series of nodes representing the possible steps in Tic tac toe.
- Generate the corresponding game tree.
- Report "Win" and the "winning" status if the game tree has one
- Report "Tie" and the post-order order of the game tree
-
Example

-
Example

Input
Example 1

Each node of the tree consists of:
- ID
- The parent node ID (-1 represents null for root node)
- Position (x,y) and the player mark {O, or X}

- To simplify the game, each node will only have at most two possible children.
Example 2

Output
Example 1

Example 2

Tags