結果
問題 |
No.1528 Not 1
|
ユーザー |
|
提出日時 | 2022-11-02 20:56:33 |
言語 | Rust (1.83.0 + proconio) |
結果 |
WA
|
実行時間 | - |
コード長 | 549 bytes |
コンパイル時間 | 13,142 ms |
コンパイル使用メモリ | 402,856 KB |
実行使用メモリ | 8,704 KB |
最終ジャッジ日時 | 2024-07-17 09:06:46 |
合計ジャッジ時間 | 15,640 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 18 WA * 1 |
ソースコード
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 == 0 { println!("{}", (1..=n/2).map(|i| (2*i).to_string()).collect::<Vec<_>>().join(" ")); return; } if n < 6 { 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(" ")); }