結果
| 問題 |
No.289 数字を全て足そう
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-07-31 17:41:34 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 254 bytes |
| コンパイル時間 | 13,283 ms |
| コンパイル使用メモリ | 383,696 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-31 17:41:49 |
| 合計ジャッジ時間 | 14,224 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
コンパイルメッセージ
warning: unused imports: `BTreeSet`, `HashMap`, `hash::Hash`
--> src/main.rs:2:19
|
2 | collections::{BTreeSet, HashMap},
| ^^^^^^^^ ^^^^^^^
3 | hash::Hash,
| ^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
ソースコード
use std::{
collections::{BTreeSet, HashMap},
hash::Hash,
};
fn main() {
proconio::input! {
s: String
}
let a = s
.chars()
.filter_map(|c| c.to_digit(10))
.fold(0, |a, b| a + b);
println!("{a}");
}