結果

問題 No.3287 Golden Ring
ユーザー ゼリトキ
提出日時 2025-10-03 22:32:26
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 692 bytes
コンパイル時間 2,952 ms
コンパイル使用メモリ 275,824 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2025-10-03 22:32:30
合計ジャッジ時間 3,355 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const long long mod=998244353;
const long long mod100=1000000007;
int main(){
    cin.tie(0)->sync_with_stdio(0);
    cout.tie(0);
    int N;
    cin>>N;
    if(N==2){
        cout<<"No"<<endl;
        return 0;
    }
    if(N%2==1){
        cout<<"Yes\n";
        for(int i=1;i<=N;i++){
            cout<<i;
            if(i==N) cout<<endl;
            else cout<<" ";
        }
    }
    else{
        cout<<"Yes\n";
        cout<<"2 1 ";
        for(int i=3;i<=N;i++){
            cout<<i;
            if(i==N) cout<<endl;
            else cout<<" ";
        }
    }
}
0