35 lines
664 B
Rust
35 lines
664 B
Rust
use proconio::input;
|
|
|
|
fn main() {
|
|
input!{
|
|
n: usize,
|
|
k: usize,
|
|
q: usize,
|
|
a: [usize; k],
|
|
l: [usize; q],
|
|
};
|
|
|
|
let mut board = vec![false; n];
|
|
let mut positions = vec![0; k];
|
|
let mut p = 0;
|
|
|
|
for pos in a {
|
|
board[pos - 1] = true;
|
|
positions[p] = pos - 1;
|
|
p += 1;
|
|
}
|
|
|
|
for turn in l {
|
|
let pos = positions[turn - 1];
|
|
if pos != n - 1 && !board[pos + 1] {
|
|
board[pos] = false;
|
|
board[pos + 1] = true;
|
|
positions[turn - 1] = pos + 1;
|
|
}
|
|
}
|
|
|
|
for pos in positions {
|
|
print!("{} ", pos + 1);
|
|
} print!("\n");
|
|
}
|