結果

問題 No.1528 Not 1
ユーザー phsplsphspls
提出日時 2022-11-02 20:58:36
言語 Rust
(1.77.0)
結果
WA  
実行時間 -
コード長 568 bytes
コンパイル時間 2,297 ms
コンパイル使用メモリ 151,684 KB
実行使用メモリ 8,660 KB
最終ジャッジ日時 2023-09-24 08:43:10
合計ジャッジ時間 3,772 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 12 ms
7,160 KB
testcase_02 AC 4 ms
4,376 KB
testcase_03 AC 6 ms
4,376 KB
testcase_04 AC 11 ms
7,628 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 7 ms
5,372 KB
testcase_07 AC 11 ms
7,472 KB
testcase_08 AC 6 ms
4,704 KB
testcase_09 AC 3 ms
4,376 KB
testcase_10 AC 6 ms
4,576 KB
testcase_11 WA -
testcase_12 AC 1 ms
4,380 KB
testcase_13 AC 1 ms
4,376 KB
testcase_14 AC 1 ms
4,376 KB
testcase_15 WA -
testcase_16 AC 1 ms
4,380 KB
testcase_17 AC 0 ms
4,500 KB
testcase_18 AC 12 ms
7,948 KB
testcase_19 AC 14 ms
8,660 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

fn main() {
    let mut n = String::new();
    std::io::stdin().read_line(&mut n).ok();
    let n: usize = n.trim().parse().unwrap();

    if n > 2 && n % 2 == 0 {
        println!("{}", (1..=n/2).map(|i| (2*i).to_string()).collect::<Vec<_>>().join(" "));
        return;
    }
    if n < 6 || n == 2 {
        println!("-1");
        return;
    }
    let mut result = vec![2, 4];
    for i in 4..=n/2 {
        result.push(i*2);
    }
    result.push(6);
    result.push(3);
    println!("{}", result.iter().map(|&v| v.to_string()).collect::<Vec<_>>().join(" "));
}
0