83432024-01-14 19:40:24eokorHőségriadó (50 pont)cpp17Wrong answer 8/5024ms3264 KiB
#include <iostream>

using namespace std;

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

    for(long int i=1;i<=n;i++)
    {
        if(pont)
        {
            pont = false;
            for(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 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/03ms1876 KiB
2Wrong answer0/024ms2116 KiB
3Accepted2/23ms2248 KiB
4Accepted2/23ms2452 KiB
5Wrong answer0/23ms2484 KiB
6Accepted2/23ms2616 KiB
7Accepted2/23ms2812 KiB
8Wrong answer0/43ms2856 KiB
9Wrong answer0/410ms2984 KiB
10Wrong answer0/413ms3096 KiB
11Wrong answer0/416ms3072 KiB
12Wrong answer0/413ms3076 KiB
13Wrong answer0/419ms3068 KiB
14Wrong answer0/44ms3072 KiB
15Wrong answer0/421ms3204 KiB
16Wrong answer0/421ms3264 KiB
17Wrong answer0/421ms3264 KiB