結果

問題 No.9011 数字を全て足そう(数字だけ)
ユーザー ino
提出日時 2026-05-14 00:24:55
言語 Rust
(1.97.1 + proconio + num + itertools + ACL)
コンパイル:
/usr/bin/rustc_custom
実行:
./target/release/main
結果
AC  
実行時間 0 ms / 2,000 ms
+ 832µs
コード長 255 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,896 ms
コンパイル使用メモリ 185,252 KB
実行使用メモリ 9,920 KB
最終ジャッジ日時 2026-09-26 18:55:13
合計ジャッジ時間 4,861 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge4_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

use proconio::input;
fn main() {
    input! {
        n: String,
    }

    let mut ans: u32 = 0;

    for s in n.chars() {
        let num = s.to_digit(10);
        if let Some(f) = num {
            ans += f;
        }
    }

    println!("{}", ans);
}
0