結果
| 問題 | No.289 数字を全て足そう |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-07-31 17:41:34 |
| 言語 | Rust (1.97.1 + proconio + num + itertools) |
| 結果 |
AC
|
| 実行時間 | 0 ms / 1,000 ms |
| + 863µs | |
| コード長 | 254 bytes |
| 記録 | |
| コンパイル時間 | 504 ms |
| コンパイル使用メモリ | 182,344 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-08-24 18:07:18 |
| 合計ジャッジ時間 | 2,432 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_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}");
}