use proconio::{input, marker::{Chars, Usize1}}; fn main() { input! { n: usize, // 文字数 s: Chars, // 文字列 p: [Usize1; n], // 出力順 } for idx in p { print!("{}", s[idx]); } println!(); }