結果

問題 No.1335 1337
ユーザー phspls
提出日時 2022-11-19 21:30:45
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 443 bytes
コンパイル時間 23,278 ms
コンパイル使用メモリ 401,780 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-21 02:49:09
合計ジャッジ時間 23,616 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

fn main() {
    let mut a = String::new();
    std::io::stdin().read_line(&mut a).ok();
    let a = a.trim().chars().collect::<Vec<_>>();
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    let s = s.trim().chars().collect::<Vec<_>>();

    let result = s.iter().map(|&c| c.to_string().parse::<usize>().map(|i| a[i].to_string()).unwrap_or(c.to_string())).collect::<Vec<_>>().join("");
    println!("{}", result);
}
0