mod, find the number of spanning trees of the graph modulo
Bobo has a bipartite graph with (n + m) vertices x_1, x_2, dots, x_n x 1 ,x 2 ,…,x n and y_1, y_2, dots, y_m y 1 ,y 2 ,…,y m . The vertex x_i x i is connected to the first a_i a i vertices in Y, namely y_1, dots, y_{a_i} y 1 ,…,y a i . Given n, m, a_1, dots, a_n a 1 ,…,a n and mathrm{mod} mod, find the number of spanning trees of the graph modulo mathrm{mod} mod.
(图片来源网络,侵删)