結果
| 問題 | No.3287 Golden Ring | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2025-10-03 21:27:11 | 
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 2,000 ms | 
| コード長 | 393 bytes | 
| コンパイル時間 | 2,672 ms | 
| コンパイル使用メモリ | 278,060 KB | 
| 実行使用メモリ | 7,716 KB | 
| 最終ジャッジ日時 | 2025-10-03 21:27:24 | 
| 合計ジャッジ時間 | 3,666 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 14 | 
ソースコード
#include <bits/stdc++.h>
#include <cstdlib>
#include <math.h>
using namespace std;
using ll = long long;
int main(){
    int n;
    cin >> n;
    if(n==2){
        cout << "No" << endl;
        return 0;
    }
    cout << "Yes" << endl;
    vector<int>a(n);
    for(int i=0;i<n;i++)a[i]=i+1;
    if(n%2==0)swap(a[0],a[1]);
    for(int i:a)cout << i << " ";
    cout << endl;
    return 0;
}
            
            
            
        