Interesting Graph
Time limit5sMemory limit512 MB
Given a graph where every 7-vertex subset has a pair separated by a outside vertex, output the chromatic polynomial values for 1 to n colors modulo 998244353.
- Level
Hard9 of 10
- Topics
- Graph, Dynamic programming, Math
- Solved
- No attempts yet
Problem
You have an undirected graph with the following property. For any subset of 7 vertices of the graph, there exist two vertices and a vertex such that every path from to passes through . Count the ways to properly color this graph with colors. Each vertex gets one color, and a coloring is proper if the two endpoints of every edge have different colors. Print the counts modulo 998244353.
Input
The first line contains two integers and , the number of vertices and the number of edges, where . Each of the next lines contains two integers and (, ), describing an edge between vertices and . No edge is given more than once. The input is guaranteed to satisfy the property stated above.
Output
Print one line with space-separated integers. The -th integer is the number of proper colorings of the graph with colors, modulo 998244353.