Connected Components?

题意翻译

给出一个 $n$ 个点,$\dfrac{n(n-1)}{2}-m$ 条边的无向图,问图中有多少连通分量以及每个连通分量有多少点。 输入中给出 $m$ 对点,表示这一对点之间没有边,否则就是有边 输出连通分量的个数以及每个连通分量有多少个点。输出的点数序列必须为单调不降的。

题目描述

You are given an undirected graph consisting of $ n $ vertices and ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF920E/2671f3d87e6b285ebb30abeafea800e65bb56d51.png) edges. Instead of giving you the edges that exist in the graph, we give you $ m $ unordered pairs ( $ x,y $ ) such that there is no edge between $ x $ and $ y $ , and if some pair of vertices is not listed in the input, then there is an edge between these vertices. You have to find the number of connected components in the graph and the size of each component. A connected component is a set of vertices $ X $ such that for every two vertices from this set there exists at least one path in the graph connecting these vertices, but adding any other vertex to $ X $ violates this rule.

输入输出格式

输入格式


The first line contains two integers $ n $ and $ m $ ( $ 1<=n<=200000 $ , ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF920E/2a08d4fdef413c2e634516e97a2188a97c148ac8.png)). Then $ m $ lines follow, each containing a pair of integers $ x $ and $ y $ ( $ 1<=x,y<=n $ , $ x≠y $ ) denoting that there is no edge between $ x $ and $ y $ . Each pair is listed at most once; ( $ x,y $ ) and ( $ y,x $ ) are considered the same (so they are never listed in the same test). If some pair of vertices is not listed in the input, then there exists an edge between those vertices.

输出格式


Firstly print $ k $ — the number of connected components in this graph. Then print $ k $ integers — the sizes of components. You should output these integers in non-descending order.

输入输出样例

输入样例 #1

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

输出样例 #1

2
1 4