Submission #19443273


Source Code Expand

Copy
use proconio::input;

fn main() {
    input! {
        h: usize,
        w: usize,
        a: [[i32; w]; h],
    }
    let mut sum = 0;
    let mut min = std::i32::MAX;
    for row in &a {
        for value in row {
            sum += value;
            min = min.min(*value);
        }
    }
    // sum は h × w 個の総和
    // min は h × w 個の最小値
    println!("{}", sum - min * h as i32 * w as i32);
    // h as i32 で, usize から i32 に変換できる
}

Submission Info

Submission Time
Task B - Blocks on Grid
User toga57
Language Rust (1.42.0)
Score 200
Code Size 501 Byte
Status AC
Exec Time 7 ms
Memory 2148 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 14
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_11.txt, random_12.txt, random_13.txt, sample_01.txt, sample_02.txt, sample_03.txt
Case Name Status Exec Time Memory
random_01.txt AC 7 ms 2084 KB
random_02.txt AC 2 ms 2076 KB
random_03.txt AC 3 ms 2084 KB
random_04.txt AC 2 ms 1884 KB
random_05.txt AC 2 ms 2016 KB
random_06.txt AC 2 ms 2028 KB
random_07.txt AC 2 ms 2080 KB
random_08.txt AC 2 ms 2076 KB
random_11.txt AC 2 ms 2132 KB
random_12.txt AC 2 ms 2148 KB
random_13.txt AC 2 ms 2068 KB
sample_01.txt AC 2 ms 1996 KB
sample_02.txt AC 2 ms 2036 KB
sample_03.txt AC 3 ms 1996 KB