Submission #516156

#TimeUsernameProblemLanguageResultExecution timeMemory
516156mosiashvililukaNewspapers (CEOI21_newspapers)C++14
8 / 100
1 ms348 KiB
#include<bits/stdc++.h> using namespace std; int a,b,c,d,e,i,j,ii,jj,zx,xc,p[5009],pi; vector <int> v[1009]; void print(){ cout<<"YES\n"; cout<<pi<<"\n"; for(i=1; i<=pi; i++){ cout<<p[i]<<" "; } exit(0); } int main(){ ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0); cin>>a>>b; for(i=1; i<=b; i++){ cin>>c>>d; v[c].push_back(d); v[d].push_back(c); } if(a==1){ pi=1;p[1]=1; print(); } if(a==2){ pi=2;p[1]=1;p[2]=1; print(); } for(i=2; i<a; i++){ pi++;p[pi]=i; } for(i=a-1; i>=2; i--){ pi++;p[pi]=i; } print(); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...