結果

問題 No.3035 文字列のみの反転
ユーザー atcoder8
提出日時 2025-02-28 21:26:41
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 329 bytes
コンパイル時間 11,478 ms
コンパイル使用メモリ 400,484 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2025-02-28 21:27:10
合計ジャッジ時間 11,645 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

use proconio::input;

fn main() {
    input! {
        s: String,
    }

    let alphabet_length = s.chars().take_while(|&c| ('a'..='z').contains(&c)).count();
    let ans = s[..alphabet_length]
        .chars()
        .rev()
        .chain(s[alphabet_length..].chars())
        .collect::<String>();
    println!("{}", ans);
}
0