Submission #1037157

#TimeUsernameProblemLanguageResultExecution timeMemory
1037157DzadzoNewspapers (CEOI21_newspapers)C++14
8 / 100
2 ms2904 KiB
#include <bits/stdc++.h> #define ll long long #define pb push_back #define S second #define F first #define pii pair<ll,ll> #define vi vector<int> #define vvi vector<vi> #define vvvi vector<vvi> #define vp vector<pii> #define vvp vector<vp> #define vb vector<bool> #define vvb vector<vb> #define INF 1000000000000000 #define MOD 1000000007 #define MAXN 100000 using namespace std; #pragma GCC optimize("O3,unroll-loops") #pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt") vvi adj(MAXN+1); signed main() { int n,m; cin>>n>>m; for (int i=1;i<=m;i++) { int u,v; cin>>u>>v; adj[u].pb(v); adj[v].pb(u); } cout<<"YES\n"; if (n==1) { cout<<"1\n1"; exit(0); } if (n==2) { cout<<"2\n1 1"; exit(0); } cout<<2*n-4<<"\n"; for (int i=2;i<n;i++)cout<<i<<" "; for (int i=n-1;i>=2;i--)cout<<i<<" "; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...