Submit | All submissions | Best solutions | Back to list |
EIUDEG - Degree |
Given an undirected graph of n vertices and m edges. Output the degree of vertices.
Input
The first line contains two integers n and m ( 1 ≤ n ≤ 1000, 0 ≤ m ≤ min(105, n*(n-1)/2) )
Each line in the next m lines contains two integers u, v(1 ≤ u, v ≤ n ) - representing the connecting edge from u to v.
Output
A line of n numbers: deg [1], deg [2] ... deg [n], respectively, is the degree of vertices 1,2 ... n.
Example
Input: 2 1 1 2 Output: 1 1
Added by: | Ha Minh Ngoc |
Date: | 2015-12-24 |
Time limit: | 0.400s-1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: GOSU |