Submit | All submissions | Best solutions | Back to list |
EISPGRH - Question 1 |
You are given an undirected graph that has n vertices and m edges. You should check if the given graph is a simple graph.
Input
The first line contains two integers n, m (0 < n, m ≤ 105).
Each of the next m lines contains two integers a, b representing an edge that connects vertex a and vertex b (0 ≤ a, b < n).
Output
Print “YES” if the given graph is a simple graph, otherwise print “NO”. The output is case-sensitive.
Sample
https://drive.google.com/file/d/1N1-NJnSAq7MrNJ9Oy3_f5en2PyOVNKd1/view?usp=sharing
Input |
Output |
|
Input |
Output |
5 4 0 0 0 1 1 2 2 1 |
NO |
|
5 4 0 1 1 2 2 3 0 3 |
YES |
Added by: | Ha Minh Ngoc |
Date: | 2021-07-11 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: GOSU |