3개의 배열과 트리
Time Limit: 1 SecMemory Limit: 1024 MiB
Example Input 1
1
5
1 2
1 3
3 4
3 5
Example Output 1
1 0 0 0 0 
2 0 0 2 2 
0 0 0 2 2 
Example Input 2
2
5
1 0 0 0 0
2 0 0 2 2
Example Output 2
1 2
1 3
3 4
3 5
Example Input 3
1
5
1 2
1 3
3 4
3 5
Example Output 3
1 0 0 0 0 
2 0 0 2 2 
0 0 0 2 2 
Example Input 4
2
5
1 0 0 0 0
0 0 0 2 2
Example Output 4
1 2
1 3
3 4
3 5
Language-Specific Restrictions
© 2023-2025. All rights reserved.
Powered by @Rn
logo