제출 #1180572

#제출 시각아이디문제언어결과실행 시간메모리
1180572mertbbmNewspapers (CEOI21_newspapers)C++20
0 / 100
0 ms324 KiB
#include <bits/stdc++.h>
using namespace std;

#define int long long 
#define ld long double
#define show(x,y) cout << y << " " << #x << endl;
#define show2(x,y,i,j) cout << y << " " << #x << "  " << j << " " << #i << endl;
#define show3(x,y,i,j,p,q) cout << y << " " << #x << "  " << j << " " << #i << "  " << q << " " << #p << endl;
#define show4(x,y) for(auto it:y) cout << it << " "; cout << #x << endl;
typedef pair<int,int>pii;
mt19937_64 rng(chrono::system_clock::now().time_since_epoch().count());

vector<int>adj[1005];

void solve(){
	int n,m;
	cin >> n >> m;
	
	int temp,temp2;
	for(int x=0;x<m;x++){
		cin >> temp >> temp2;
		adj[temp].push_back(temp2);
		adj[temp2].push_back(temp);
	}
	
	if(m==n-1)cout << "YES\n";
	else cout << "NO\n";
	//if(n==1){
		//cout << "1\n1\n";
	//}
	//else if(n==2){
		//cout << "2\n1 1\n";
	//}
	//else if(n>=3){
		//cout << (n-2)*2 << "\n";
		//for(int y=2;y<n;y++) cout << y << " ";
		//for(int y=n-1;y>1;y--) cout << y << " ";
	//}
	
}
																   
int32_t main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	int t=1;
	//cin >> t;
	while(t--){
		solve();
	}
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...