結果

問題 No.3287 Golden Ring
ユーザー Plan8
提出日時 2025-10-18 11:13:25
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 312 bytes
コンパイル時間 12,644 ms
コンパイル使用メモリ 399,576 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2025-10-18 11:13:53
合計ジャッジ時間 14,488 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

use proconio::input;

fn main() {
    input! {
        n: usize,
    }

    if n == 2 {
        println!("No");
        return;
    }
    println!("Yes");
    let mut ans = (1..=n).map(|i| i.to_string()).collect::<Vec<_>>();
    if n % 2 == 0 {
        ans.swap(0, 1);
    }
    println!("{}", ans.join(" "));
}
0