結果

問題 No.3267 PQ Straight
ユーザー urectanc
提出日時 2025-09-12 23:29:42
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 48 ms / 1,000 ms
コード長 710 bytes
コンパイル時間 12,731 ms
コンパイル使用メモリ 400,404 KB
実行使用メモリ 17,236 KB
最終ジャッジ日時 2025-09-12 23:45:31
合計ジャッジ時間 15,760 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

use proconio::input;

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

    if n % 2 == 0 {
        println!("No");
    } else {
        println!("Yes");

        let a = (n + 3) / 2;
        let p = (1..=n)
            .step_by(2)
            .chain((2..n).step_by(2))
            .collect::<Vec<_>>();
        let q = (0..n).map(|i| a + i - p[i]).collect::<Vec<_>>();

        println!(
            "{}",
            p.iter()
                .map(|x| x.to_string())
                .collect::<Vec<_>>()
                .join(" ")
        );
        println!(
            "{}",
            q.iter()
                .map(|x| x.to_string())
                .collect::<Vec<_>>()
                .join(" ")
        );
    }
}
0