Submission #39339325


Source Code Expand

use proconio::input;

fn main() {
    input! {
        n: usize,
        p: [usize; n],
    };
    let mut count = 0_usize;
    let mut min = p[0];
    for p_i in p {
        if p_i <= min {
            count += 1;
            min = p_i;
        }
    }
    let ans = count;
    println!("{}", ans);
}

Submission Info

Submission Time
Task C - Low Elements
User bouzuya
Language Rust (1.42.0)
Score 300
Code Size 302 Byte
Status AC
Exec Time 16 ms
Memory 4664 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 5
AC × 20
Set Name Test Cases
Sample 00-sample-01.txt, 00-sample-02.txt, 00-sample-03.txt, 00-sample-04.txt, 00-sample-05.txt
All 00-sample-01.txt, 00-sample-02.txt, 00-sample-03.txt, 00-sample-04.txt, 00-sample-05.txt, dec.txt, inc.txt, killer_01.txt, killer_02.txt, killer_03.txt, rand_01.txt, rand_02.txt, rand_03.txt, rand_04.txt, rand_05.txt, small_01.txt, small_02.txt, small_03.txt, small_04.txt, small_05.txt
Case Name Status Exec Time Memory
00-sample-01.txt AC 5 ms 1908 KiB
00-sample-02.txt AC 1 ms 2040 KiB
00-sample-03.txt AC 2 ms 1892 KiB
00-sample-04.txt AC 1 ms 2044 KiB
00-sample-05.txt AC 1 ms 1968 KiB
dec.txt AC 14 ms 4640 KiB
inc.txt AC 15 ms 4568 KiB
killer_01.txt AC 15 ms 4472 KiB
killer_02.txt AC 14 ms 4592 KiB
killer_03.txt AC 14 ms 4636 KiB
rand_01.txt AC 15 ms 4664 KiB
rand_02.txt AC 16 ms 4584 KiB
rand_03.txt AC 16 ms 4568 KiB
rand_04.txt AC 15 ms 4480 KiB
rand_05.txt AC 15 ms 4584 KiB
small_01.txt AC 2 ms 2052 KiB
small_02.txt AC 2 ms 1996 KiB
small_03.txt AC 2 ms 2040 KiB
small_04.txt AC 2 ms 2084 KiB
small_05.txt AC 2 ms 1984 KiB