83452024-01-14 19:43:58eokorHőségriadó (50 pont)cpp17Wrong answer 8/5024ms3736 KiB
#include <iostream>

using namespace std;

int main()
{
    long long int n,k,l,h,x;
    bool pont = true;
    long long int db=0;
    cin>>n>>k>>l>>h;

    for(long long int i=1;i<=n;i++)
    {
        if(pont)
        {
            pont = false;
            for(long long int j=i; j<i+k && j<=n ;j++)
            {
                cin>>x;
                if(x<h)
                    {
                        i=j;
                        pont = true;
                        break;
                    }
            }
            if(!pont)
                {
                    i+=k-1;
                    db++;
                }
        }
        else {
            pont = true;
            for(long long int j=i; j<i+l && j<=n ;j++)
            {
                cin>>x;
                if(x>h)
                    {
                        i=j;
                        pont = false;
                        break;
                    }
            }
            if(pont)
                i = i+l-1;
        }
    }
    cout<<db;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base8/50
1Accepted0/03ms1752 KiB
2Wrong answer0/024ms1912 KiB
3Accepted2/23ms2152 KiB
4Accepted2/23ms2408 KiB
5Wrong answer0/23ms2604 KiB
6Accepted2/23ms2812 KiB
7Accepted2/23ms3008 KiB
8Wrong answer0/43ms3056 KiB
9Wrong answer0/412ms3324 KiB
10Wrong answer0/414ms3204 KiB
11Wrong answer0/416ms3320 KiB
12Wrong answer0/414ms3444 KiB
13Wrong answer0/419ms3420 KiB
14Wrong answer0/44ms3632 KiB
15Wrong answer0/423ms3656 KiB
16Wrong answer0/423ms3704 KiB
17Wrong answer0/423ms3736 KiB