結果

問題 No.3035 文字列のみの反転
コンテスト
ユーザー atcoder8
提出日時 2025-02-28 21:26:41
言語 Rust
(1.94.0 + proconio + num + itertools)
コンパイル:
/usr/bin/rustc_custom
実行:
./target/release/main
結果
AC  
実行時間 0 ms / 2,000 ms
コード長 329 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 591 ms
コンパイル使用メモリ 193,756 KB
実行使用メモリ 9,264 KB
最終ジャッジ日時 2026-07-06 11:37:40
合計ジャッジ時間 1,926 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 12
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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