結果

問題 No.3035 文字列のみの反転
ユーザー Blue_S
提出日時 2025-01-08 23:19:08
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 491 bytes
コンパイル時間 15,052 ms
コンパイル使用メモリ 403,100 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2025-01-17 22:37:10
合計ジャッジ時間 16,011 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

use proconio::{input, marker::Bytes};

fn main() {
    input! {
        s: Bytes,
    }
    let x = s.iter().position(|c| b'0' <= *c && *c <= b'9').unwrap();
    println!(
        "{}{}",
        s[..x]
            .iter()
            .rev()
            .map(|c| (*c as char).to_string())
            .collect::<Vec<_>>()
            .join(""),
        s[x..]
            .iter()
            .map(|c| (*c as char).to_string())
            .collect::<Vec<_>>()
            .join("")
    );
}
0