제출 #967643

#제출 시각아이디문제언어결과실행 시간메모리
967643antonNewspapers (CEOI21_newspapers)C++17
8 / 100
1 ms348 KiB
#include<bits/stdc++.h>

using namespace std;
#define int long long
#define pii pair<int, int>
const int MAX_N = 1e3;
vector<int> adj[MAX_N];

signed main(){
    cin.tie(NULL);
    ios_base::sync_with_stdio(false);
    int n, m;
    cin>>n>>m;

    cout<<"YES"<<endl;
    if(n==1){
        cout<<1<<endl;
        cout<<1<<endl;
        return 0;
    }
    if(n==2){
        cout<<2*(n-1)<<endl;
        for(int i = 0; i<n-1; i++){
            cout<<i+1<<" ";
        }
        for(int i = n-2; i>=0; i--){
            cout<<i+1<<" ";
        }
        return 0;
    }
    else{
        cout<<2*(n-2)<<endl;
        for(int i = 1; i<n-1; i++){
            cout<<i+1<<" ";
        }
        for(int i = n-2; i>=1; i--){
            cout<<i+1<<" ";
        }
    }

}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...