12768 - 電機資結 2020 HW3 Tree Anagrams
|
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
Anagrams is "變位字" in Chinese

Our "Tree Anagrams" definition is as follows:

Not All Anagrams are Valid Trees. For example, if we want "EARTH" to be the level-order sequence and "HEART" to be the in-order sequence, the tree does not exist.

Input

Output

Tags