結果
| 問題 | No.289 数字を全て足そう |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-07-31 17:41:34 |
| 言語 | Rust (1.94.0 + proconio + num + itertools) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 1,000 ms |
| コード長 | 254 bytes |
| 記録 | |
| コンパイル時間 | 2,052 ms |
| コンパイル使用メモリ | 191,060 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-04-03 19:17:15 |
| 合計ジャッジ時間 | 3,171 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
コンパイルメッセージ
warning: unused imports: `BTreeSet`, `HashMap`, and `hash::Hash`
--> src/main.rs:2:19
|
2 | collections::{BTreeSet, HashMap},
| ^^^^^^^^ ^^^^^^^
3 | hash::Hash,
| ^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) 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}");
}