Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define int long long
- #define mp make_pair
- #define pb push_back
- const int N = 101;
- bool bridge[N][N];
- signed main() {
- ios::sync_with_stdio(0);cin.tie(nullptr);cout.tie(nullptr);
- //freopen("input.txt","r",stdin);
- //freopen("output.txt","w",stdout);
- int n,m;
- cin >> n >> m;
- int sum = 0;
- for(int i=0,a,b;i<m;i++)
- {
- cin >> a >> b;
- sum += !bridge[a][b];
- bridge[a][b] = 1;
- bridge[b][a] = 1;
- }
- cout << (sum == n*(n-1)/2 ? "YES" : "NO");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement