제출 #479016

#제출 시각아이디문제언어결과실행 시간메모리
479016kshitij_sodaniNewspapers (CEOI21_newspapers)C++14
4 / 100
5 ms5012 KiB
//#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<<1<<endl; cout<<1<<endl; return 0; } cout<<n<<endl; for(int i=0;i<n;i++){ if(i==n-1){ cout<<i<<" "; continue; } cout<<i+1<<" "; } cout<<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; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...