結果

問題 No.1070 Missing a space
コンテスト
ユーザー seinyan
提出日時 2021-11-07 23:21:11
言語 Rust
(1.97.1 + proconio + num + itertools + ACL)
コンパイル:
/usr/bin/rustc_custom
実行:
./target/release/main
結果
AC  
実行時間 0 ms / 1,000 ms
+ 784µs
コード長 443 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 16,932 ms
コンパイル使用メモリ 189,184 KB
実行使用メモリ 9,900 KB
最終ジャッジ日時 2026-09-22 22:11:28
合計ジャッジ時間 2,905 ms
ジャッジサーバーID
(参考情報)
judge4_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 7
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

fn main() {
    let v: Vec<char> = input_line::<String>()[0].chars().collect();
    let mut ans = 0;
    for ch in &v[1..] {
        if *ch != '0' {
            ans += 1;
        }
    }
    print!("{}", ans);
}

fn input_line<T: std::str::FromStr>() -> Vec<T> {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}
0