134772025-01-08 08:13:38TundeHőségriadó (50 pont)cpp17Wrong answer 6/5023ms728 KiB
#include <iostream>

using namespace std;

int main()
{
    int n, k, l, f;
    cin >> n >> k >> l >> f;
    int a[n];
    int y=0;
    int db=0, u=0;
    for(int i=0; i<n; i++)
    {
        cin >> a[i];
        if(a[i]>f)
        {
            if(y!=1)
            {
                ++u;
                if(u==k)
                {
                    y=1;
                    u=0;
                    ++db;
                }
            }
        }
        else
        {
            if(y==1)
            {
                ++u;
                if(u==l)
                {
                    y=0;
                    u=0;
                }
            }
        }
    }
    cout << db;
}
SubtaskSumTestVerdictTimeMemory
base6/50
1Accepted0/01ms512 KiB
2Wrong answer0/023ms580 KiB
3Accepted2/21ms316 KiB
4Accepted2/21ms316 KiB
5Wrong answer0/21ms316 KiB
6Wrong answer0/21ms316 KiB
7Accepted2/21ms316 KiB
8Wrong answer0/41ms316 KiB
9Wrong answer0/49ms516 KiB
10Wrong answer0/412ms460 KiB
11Wrong answer0/414ms448 KiB
12Wrong answer0/412ms472 KiB
13Wrong answer0/418ms636 KiB
14Wrong answer0/43ms508 KiB
15Wrong answer0/420ms644 KiB
16Wrong answer0/420ms584 KiB
17Wrong answer0/420ms728 KiB