P4 format clarification

0
0

Was the "superior number" of each entry 1-based?

6
2 1 2 2 #0
0 4 0 2 #1
2 0 2 5 #2
2 0 2 6 #3
1 0 1 2 #4
1 0 1 3 #5

This was the example input. Do I understand correctly that #1 is EL SUENO, he has #0, #2, #3 as subordinates, #0 has #4 and #5 as subordinates?

1 answer(s)

0
6
2 1 2 2 #1
0 4 0 2 #2
2 0 2 5 #3
2 0 2 6 #4
1 0 1 2 #5
1 0 1 3 #6

The targets are numbered from 1 - N. #2 is EL SUENO. The tree is like

          2
       /  |  \
    1     3     4
  /   \
5      6

write answer 切换为英文 切换为中文


转发分享