結果

問題 No.3287 Golden Ring
コンテスト
ユーザー vjudge1
提出日時 2026-05-02 12:12:23
言語 C++23
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 678 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,585 ms
コンパイル使用メモリ 329,624 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-05-02 12:12:32
合計ジャッジ時間 5,303 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 6 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;

using i32 = int;
using i64 = long long;
#define int i64

signed main() {
    int n;
    cin >> n;
    if (n % 2 == 1) {
        cout << "Yes" << endl;
        for (int i = 0; i < n; i++) {
            cout << i + 1 << " ";
        }
        cout << endl;
        return 0;
    }

    if (n == 2) {
        cout << "Yes" << endl;
        cout << "1 2" << endl;
        return 0;
    }
    if (n == 4) {
        cout << "Yes" << endl;
        cout << "1 3 4 2" << endl;
        return 0;
    }

    if (n == 6) {
        cout << "Yes" << endl;
        cout << "1 3 4 5 6 2" << endl;
    }

    cout << "No" << endl;


    return 0;
}
0