結果

問題 No.3287 Golden Ring
ユーザー ロロット
提出日時 2025-10-04 01:12:22
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 536 bytes
コンパイル時間 3,241 ms
コンパイル使用メモリ 278,108 KB
実行使用メモリ 7,720 KB
最終ジャッジ日時 2025-10-04 01:12:28
合計ジャッジ時間 6,102 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 2
other AC * 1 WA * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define ALL(a) (a).begin(), (a).end()
#define Yes cout << "Yes" << endl
#define No cout << "No" << endl

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int N;
    cin >> N;
    if (N == 2) {
        No;
        return 0;
    }
    vector<int> ans(N);
    for (int i = 0; i < N; i++) {
        ans[i] = i + 1;
    }
    if (N % 2 == 0)
        swap(ans[N - 2], ans[N - 1]);
    for (auto x : ans)
        cout << x << ' ';
    cout << endl;
}
0