Submission #2972857

Source Code Expand

Copy
fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn solve(s:String) {
    let cnt:i32 = s.chars().map(|c| c as i32 - 0x30).sum();
    println!("{}", cnt);
}
fn main() {
    let s = read::<String>();
    solve(s);
}

Submission Info

Submission Time
Task ABC081A - Placing Marbles
User naoya_t
Language Rust (1.15.1)
Score 100
Code Size 333 Byte
Status
Exec Time 2 ms
Memory 4352 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 00_example_01.txt, 00_example_02.txt
All 100 / 100 00_example_01.txt, 00_example_02.txt, 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt
Case Name Status Exec Time Memory
00_example_01.txt 2 ms 4352 KB
00_example_02.txt 2 ms 4352 KB
01.txt 2 ms 4352 KB
02.txt 2 ms 4352 KB
03.txt 2 ms 4352 KB
04.txt 2 ms 4352 KB
05.txt 2 ms 4352 KB
06.txt 2 ms 4352 KB