1677 - 2019.5.6 電機系資料結構上機考 Scoreboard

Time

2019/05/06 18:30:00 2019/05/06 20:20:00

Clarification

# Problem Asker Description Reply Replier Reply Time For all team

# Problem Pass Rate (passed user / total user)
12253 Quiz3 (Tic Tac Toe Tree)

12253 - Quiz3 (Tic Tac Toe Tree)   

Description

Given:

  • a series of nodes representing the steps in Tic Tac Toe
  • a Tic-Tac-Toe grid (盤面)

Task:Find the path leading to the grid (盤面)

 

Input

The first integer is the number of nodes.  Each node consists of:

  • ID
  • Parent ID (-1 represent null for root)
  • X, Y
  • Mark

Each node will have at most 2 children.

The last three lines are the tic-tac-toe grid.  Each line has 3 marks (‘X’,’O’,’_’), separated by whitespaces, newline at the end.

The grid (盤面) in input definitely exists and is unique.

 

Output

IDs of the nodes in the path leading to the grid, separated by whitespaces, followed by a new line
eg. 0 1 3 8 11

 

Sample Input  Download

Sample Output  Download

Tags

Geometry FFT



Discuss