Binary Search Tree (UVa Live Archive Asia - 2011 Phuket)

http://livearchive.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=521&page=show_problem&problem=3735

問題

二部探索木がdfs順序で与えられる。その二部探索木をdfsで戻る時順に値を出力せよ。
ノード数<=10000
ノードの値<=10^6

解法

dfs順序からツリーを作る。setとかを使うと楽にできる。