86252024-01-23 21:41:16CsongiHőségriadó (50 pont)cpp17Wrong answer 8/5010ms4280 KiB
#include <iostream>
#include <bits/stdc++.h>

using namespace std;

int n, k, l, f, i, kszam = 0, lszam = 0, most, megold;
bool riado;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cin >> n >> k >> l >> f;
    for (i = 0; i < n; i++)
    {
        cin >> most;
        if (most >= f)
        {
            if (!riado)
            {
                if (kszam+1 == k)
                {
                    riado = true;
                    kszam = 0;
                    lszam = 0;
                    megold++;
                }
                else
                {
                    kszam++;
                }
            }
            else
            {
                lszam = 1;
            }
        }
        else
        {
            if (!riado)
            {
                kszam = 0;
            }
            else
            {
                if (lszam+1 == l)
                {
                    riado = false;
                    kszam = 0;
                    lszam = 0;
                }
                else
                {
                    lszam++;
                }
            }
        }
    }
    cout << megold;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base8/50
1Accepted0/03ms1892 KiB
2Wrong answer0/010ms2104 KiB
3Wrong answer0/23ms2320 KiB
4Accepted2/23ms2532 KiB
5Accepted2/23ms2736 KiB
6Accepted2/22ms2820 KiB
7Accepted2/23ms2948 KiB
8Wrong answer0/43ms3168 KiB
9Wrong answer0/46ms3372 KiB
10Wrong answer0/47ms3464 KiB
11Wrong answer0/48ms3696 KiB
12Wrong answer0/47ms3680 KiB
13Wrong answer0/48ms4084 KiB
14Wrong answer0/43ms4120 KiB
15Wrong answer0/49ms4196 KiB
16Wrong answer0/49ms4280 KiB
17Wrong answer0/49ms4280 KiB