結果
| 問題 |
No.3267 PQ Straight
|
| ユーザー |
|
| 提出日時 | 2025-09-12 22:25:06 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,051 bytes |
| コンパイル時間 | 24,492 ms |
| コンパイル使用メモリ | 397,312 KB |
| 実行使用メモリ | 7,720 KB |
| 最終ジャッジ日時 | 2025-09-12 23:42:21 |
| 合計ジャッジ時間 | 16,693 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 1 |
| other | AC * 8 WA * 14 |
ソースコード
use proconio::input;
use std::collections::HashSet;
fn main() {
input! {
n: usize,
}
if n % 2 == 0 {
println!("No");
return;
}
let mut p = vec![];
let mut p_set = HashSet::new();
let mut q = vec![];
let mut target = (n + 3) / 2;
for i in 1..=n / 2 + 1 {
if p_set.contains(&i) {
p.push(target - i);
p_set.insert(target - i);
q.push(i);
} else {
p.push(i);
p_set.insert(i);
q.push(target - i);
}
target += 1;
if i == n / 2 + 1 {
break;
}
if p_set.contains(&i) {
p.push(target - i);
p_set.insert(target - i);
q.push(i);
} else {
p.push(i);
p_set.insert(i);
q.push(target - i);
}
target += 1;
}
for i in p {
print!("{} ", i);
}
println!();
for i in q {
print!("{} ", i);
}
println!();
println!("Yes");
}