提出 #44879115


ソースコード 拡げる

use proconio::{input, marker::Usize1};

fn main() {
    input! {
        n: usize,
        m: usize,
        h: [usize; n],
        ab: [(Usize1, Usize1); m],
    };

    let mut edges = vec![vec![]; n];
    for (a_i, b_i) in ab {
        edges[a_i].push(b_i);
        edges[b_i].push(a_i);
    }

    let mut count = 0_usize;
    for (h_i, edges_i) in h.iter().copied().zip(edges.into_iter()) {
        if edges_i.iter().copied().all(|j| h[j] < h_i) {
            count += 1;
        }
    }

    let ans = count;
    println!("{}", ans);
}

提出情報

提出日時
問題 C - Peaks
ユーザ bouzuya
言語 Rust (1.42.0)
得点 300
コード長 542 Byte
結果 AC
実行時間 41 ms
メモリ 12172 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 300 / 300
結果
AC × 2
AC × 19
セット名 テストケース
Sample Sample_01.txt, Sample_02.txt
All Sample_01.txt, Sample_02.txt, maxrand_01.txt, maxrand_02.txt, maxrand_03.txt, ni_01.txt, ni_02.txt, rand_01.txt, rand_02.txt, rand_03.txt, same_01.txt, same_02.txt, same_03.txt, small_01.txt, small_02.txt, small_03.txt, uni_01.txt, uni_02.txt, uni_03.txt
ケース名 結果 実行時間 メモリ
Sample_01.txt AC 6 ms 2052 KiB
Sample_02.txt AC 1 ms 1940 KiB
maxrand_01.txt AC 41 ms 12136 KiB
maxrand_02.txt AC 39 ms 12172 KiB
maxrand_03.txt AC 39 ms 12140 KiB
ni_01.txt AC 1 ms 2076 KiB
ni_02.txt AC 2 ms 2072 KiB
rand_01.txt AC 39 ms 12124 KiB
rand_02.txt AC 38 ms 12100 KiB
rand_03.txt AC 38 ms 12068 KiB
same_01.txt AC 36 ms 11520 KiB
same_02.txt AC 37 ms 11588 KiB
same_03.txt AC 37 ms 11560 KiB
small_01.txt AC 1 ms 1988 KiB
small_02.txt AC 1 ms 2076 KiB
small_03.txt AC 2 ms 2080 KiB
uni_01.txt AC 31 ms 11740 KiB
uni_02.txt AC 34 ms 11712 KiB
uni_03.txt AC 35 ms 11600 KiB