//#pragma GCC optimize("Ofast,unroll-loops")
#include <bits/stdc++.h>
using namespace std;
typedef long long llo;
#define mp make_pair
#define pb push_back
#define a first
#define b second
#define endl '\n'
vector<int> adj[200001];
int dp[200001];
int co[200001];
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n,m;
cin>>n>>m;
for(int i=0;i<m;i++){
int aa,bb;
cin>>aa>>bb;
aa--;
bb--;
adj[aa].pb(bb);
adj[bb].pb(aa);
}
if(m!=n-1){
cout<<"NO"<<endl;
}
else{
cout<<"YES"<<endl;
}
/* if(n==1){
cout<<"YES"<<endl;
cout<<"1"<<endl;
cout<<"1"<<endl;
}
else if(n==2){
cout<<"YES"<<endl;
cout<<"2"<<endl;
cout<<"1 1"<<endl;
}
else if(n==3){
cout<<"YES"<<endl;
cout<<"2"<<endl;
cout<<"2 2"<<endl;
}
else{
cout<<"NO"<<endl;
}
*/
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
4940 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
4940 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
4940 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |