86262024-01-23 21:46:01CsongiHőségriadó (50 pont)cpp17Wrong answer 14/5010ms3804 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 = 0;
            }
        }
        else
        {
            if (!riado)
            {
                kszam = 0;
            }
            else
            {
                if (lszam+1 == l)
                {
                    riado = false;
                    kszam = 0;
                    lszam = 0;
                }
                else
                {
                    lszam++;
                }
            }
        }
    }
    cout << megold;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base14/50
1Accepted0/03ms1896 KiB
2Wrong answer0/010ms2124 KiB
3Accepted2/23ms2480 KiB
4Accepted2/23ms2652 KiB
5Accepted2/23ms2864 KiB
6Accepted2/23ms2956 KiB
7Accepted2/23ms3172 KiB
8Wrong answer0/43ms3128 KiB
9Wrong answer0/46ms3228 KiB
10Wrong answer0/47ms3248 KiB
11Wrong answer0/48ms3224 KiB
12Wrong answer0/47ms3456 KiB
13Wrong answer0/48ms3492 KiB
14Accepted4/43ms3704 KiB
15Wrong answer0/49ms3804 KiB
16Wrong answer0/49ms3796 KiB
17Wrong answer0/49ms3792 KiB