#P10779. BZOJ4316 小 C 的独立集

    ID: 12247 远端评测题 1000ms 512MiB 尝试: 0 已通过: 0 显示难度提高+/省选− 上传者: 标签>动态规划 DP仙人掌

BZOJ4316 小 C 的独立集

Problem Description

Given a simple undirected graph G=(V,E)G = (V, E), it is guaranteed that each edge belongs to one and only one simple cycle. Find the size of the maximum independent set of GG.

Input Format

The first line contains two positive integers n,mn, m, representing the number of vertices and the number of edges in the graph.

The next mm lines each contain two positive integers u,vu, v, describing an undirected edge.

Output Format

Output the size of the maximum independent set of GG.

5 6
1 2
2 3
3 1
3 4
4 5
3 5
2

Hint

For 100%100\% of the testdata, 1n5×1041 \leq n \leq 5 \times 10^4, and 1m6×1041 \leq m \leq 6 \times 10^4.

Translated by ChatGPT 5