91902024-02-17 19:40:52MrChipserHőségriadó (50 pont)cpp17Wrong answer 8/5024ms4340 KiB
#include <iostream>

using namespace std;

int main()
{
    int n, k,l,f;
    cin >> n >>k >> l >> f;
    int a[n];
    for(int i = 0; i < n; i++)
        cin >> a[i];
    bool riado = false;
    int rsz = 0;
    int felett = 0;
    int alatt = 0;
    for(int i = 0; i < n; i++)
    {
        if(!riado)
        {
            if(a[i]>f)
                felett++;
            else
                felett=0;
            if(felett==k)
            {
                riado = true;
                felett = 0;
                rsz++;
                //cout << a[i] << endl;
            }
        }
        else
        {
            if(a[i]<f)
                alatt++;
            else
                alatt = 0;
            if(alatt=l)
            {
                riado = false;
                alatt = 0;
            }
        }
    }
    cout << rsz;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base8/50
1Accepted0/03ms1876 KiB
2Wrong answer0/024ms2712 KiB
3Accepted2/23ms2176 KiB
4Accepted2/23ms2416 KiB
5Accepted2/22ms2500 KiB
6Accepted2/23ms2656 KiB
7Wrong answer0/23ms2780 KiB
8Wrong answer0/43ms2868 KiB
9Wrong answer0/410ms3268 KiB
10Wrong answer0/414ms3620 KiB
11Wrong answer0/416ms3700 KiB
12Wrong answer0/413ms3660 KiB
13Wrong answer0/419ms4000 KiB
14Wrong answer0/44ms3536 KiB
15Wrong answer0/421ms4340 KiB
16Wrong answer0/423ms4164 KiB
17Wrong answer0/423ms3992 KiB