Submission #15521384


Source Code Expand

Copy
use proconio::input;

fn main() {
    input! {
        n: usize,
        k: usize,
        a: [i64; n],
    };
    if k == 1 {
        println!("{}", n);
        return;
    }
    let mut ans = 0;
    let mut c = 1;
    for i in 1..n {
        if a[i - 1] < a[i] {
            c += 1;
            if c >= k {
                ans += 1;
            }
        } else {
            c = 1;
        }
    }
    println!("{}", ans);
}

Submission Info

Submission Time
Task B - 解像度が低い。
User bouzuya
Language Rust (1.42.0)
Score 100
Code Size 428 Byte
Status
Exec Time 28 ms
Memory 6248 KB

Judge Result

Set Name Score / Max Score Test Cases
All 100 / 100 decr2_1.txt, decr2_2.txt, decr_1.txt, decr_2.txt, incr2_1.txt, incr2_2.txt, incr2_3.txt, incr_1.txt, incr_2.txt, incr_3.txt, incr_4.txt, incr_5.txt, ins_1.txt, ins_2.txt, ins_3.txt, ins_4.txt, ins_5.txt, ins_6.txt, ins_7.txt, ins_8.txt, ins_9.txt, random_1.txt, random_2.txt, random_3.txt, random_4.txt, random_5.txt, sample_1.txt, sample_2.txt, sample_3.txt, sample_4.txt
Case Name Status Exec Time Memory
decr2_1.txt 9 ms 2284 KB
decr2_2.txt 5 ms 2340 KB
decr_1.txt 6 ms 2396 KB
decr_2.txt 4 ms 2388 KB
incr2_1.txt 13 ms 3308 KB
incr2_2.txt 8 ms 3296 KB
incr2_3.txt 9 ms 3276 KB
incr_1.txt 19 ms 6160 KB
incr_2.txt 9 ms 3324 KB
incr_3.txt 28 ms 6152 KB
incr_4.txt 22 ms 6132 KB
incr_5.txt 27 ms 6248 KB
ins_1.txt 17 ms 6184 KB
ins_2.txt 19 ms 6188 KB
ins_3.txt 24 ms 6184 KB
ins_4.txt 25 ms 6236 KB
ins_5.txt 23 ms 6152 KB
ins_6.txt 23 ms 6184 KB
ins_7.txt 21 ms 6096 KB
ins_8.txt 26 ms 6116 KB
ins_9.txt 20 ms 6064 KB
random_1.txt 28 ms 6136 KB
random_2.txt 17 ms 4800 KB
random_3.txt 20 ms 6096 KB
random_4.txt 23 ms 6160 KB
random_5.txt 19 ms 6180 KB
sample_1.txt 4 ms 1996 KB
sample_2.txt 2 ms 2044 KB
sample_3.txt 1 ms 2064 KB
sample_4.txt 2 ms 2020 KB