#P2819. 图的 m 着色问题
图的 m 着色问题
Description
For a given undirected connected graph and different colors, write a program to compute all distinct colorings of the graph.
Input Format
The first line contains positive integers , indicating that the given graph has vertices and edges, and there are colors. The vertices are labeled . The next lines each contain positive integers , representing an edge of the graph .
Output Format
At the end of the program, output the number of computed distinct coloring schemes.
5 8 4
1 2
1 3
1 4
2 3
2 4
2 5
3 4
4 5
48
Hint
The data guarantees , .
When is large, it is guaranteed that is sufficiently large.
It is guaranteed that the answer does not exceed .
The testdata is randomly sampled from valid data that meet the above conditions.
Translated by ChatGPT 5
京公网安备 11011102002149号