179532025-09-24 11:47:54szjHőségriadó (50 pont)cpp17Wrong answer 8/5023ms508 KiB
#include <bits/stdc++.h>

using namespace std;

int main()
{
    //ifstream cin("f.txt");
    int n, l, k, f, m, cn=0, cl=0,all=0;
    bool h = 0;
    cin >> n>> k >> l >> f;
    for(int i=1; i<=n; i++)
    {
        cin >> m;
        if(m<=f)
        {
            cl++;
            if(cl==l)
            {
                cl = 0;
                h=0;
                cn = 0;

            }
        }
        if(m >f)
        {
            cl = 0;
            cn++;
            if(cn >= k && !h)
            {
                h = 1;
                all++;
            }
        }

    }
    cout << all;

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base8/50
1Accepted0/01ms500 KiB
2Wrong answer0/023ms500 KiB
3Accepted2/21ms316 KiB
4Accepted2/21ms316 KiB
5Accepted2/21ms384 KiB
6Wrong answer0/21ms316 KiB
7Accepted2/21ms320 KiB
8Wrong answer0/41ms500 KiB
9Wrong answer0/49ms508 KiB
10Wrong answer0/412ms396 KiB
11Wrong answer0/414ms400 KiB
12Wrong answer0/412ms508 KiB
13Wrong answer0/417ms396 KiB
14Wrong answer0/42ms316 KiB
15Wrong answer0/420ms400 KiB
16Wrong answer0/421ms396 KiB
17Wrong answer0/420ms396 KiB