結果
| 問題 |
No.1528 Not 1
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-11-02 20:58:36 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 568 bytes |
| コンパイル時間 | 12,259 ms |
| コンパイル使用メモリ | 402,708 KB |
| 実行使用メモリ | 8,704 KB |
| 最終ジャッジ日時 | 2024-07-17 09:09:50 |
| 合計ジャッジ時間 | 14,806 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 17 WA * 2 |
ソースコード
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(" "));
}