Problem Statement
题目简述
给定长度为n的数组a[],b[],c[]
问满足以下条件的无根树的个数(对大质数取模).
1.有n+3个点标号分别为0,1,2,3,......,n-2,n-1,A,B,C
2.树的边权是正整数
3.对于标号为x的点,和点A的距离为a[x],和点B的距离为b[x],和点C的距离为c[x].
保证1<= n <= 50 ,a[],b[],c[] <= 10^8.
You are given three int[]s: distancesA, distancesB, and distancesC.
Each of these int[]s has exactly N elements.
We are interested in trees that satisfy the following conditions:
- The tree has exactly N + 3 vertices.
- Each vertex has a different label. The set of all labels is { A, B, C, 0, 1, ..., N-1 }.
- Each edge of the tree has a positive integer length.
- For each i (0 <= i < N), the distance between the vertex A and the vertex i is distancesA[i].
- For each i (0 <= i < N), the distance between the vertex B and the vertex i is distancesB[i].
- For each i (0 <= i < N), the distance between the vertex C and the vertex i is distancesC[i].
Find the number of trees that satisfy all of the conditions above, and return the number modulo 1,000,000,009.