結果
| 問題 | No.289 数字を全て足そう |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-10-13 23:17:17 |
| 言語 | Rust (1.97.1 + proconio + num + itertools + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 0 ms / 1,000 ms |
| + 856µs | |
| コード長 | 522 bytes |
| 記録 | |
| コンパイル時間 | 529 ms |
| コンパイル使用メモリ | 189,324 KB |
| 実行使用メモリ | 9,904 KB |
| 最終ジャッジ日時 | 2026-10-04 19:08:00 |
| 合計ジャッジ時間 | 2,536 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
use std::io::{self, Read};
fn read_stdin() -> Vec<String> {
let mut buffer = String::new();
io::stdin().read_to_string(&mut buffer).ok();
buffer.trim().split('\n').map(|s| s.to_string()).collect()
}
fn main() {
let input = read_stdin();
println!("{}",
&input[0]
.chars()
.fold(0, |acc, c| {
if c.is_digit(10) {
acc + c.to_digit(10).unwrap()
} else {
acc
}
})
);
}