83442024-01-14 19:42:19eokorHőségriadó (50 pont)cpp17Wrong answer 6/5024ms3900 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;
                    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;
        }
    }
    cout<<db;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base6/50
1Wrong answer0/03ms1876 KiB
2Wrong answer0/024ms2120 KiB
3Wrong answer0/23ms2424 KiB
4Wrong answer0/23ms2396 KiB
5Accepted2/23ms2600 KiB
6Accepted2/23ms2844 KiB
7Accepted2/23ms3020 KiB
8Wrong answer0/43ms3272 KiB
9Wrong answer0/410ms3356 KiB
10Wrong answer0/413ms3504 KiB
11Wrong answer0/414ms3676 KiB
12Wrong answer0/413ms3760 KiB
13Wrong answer0/419ms3900 KiB
14Wrong answer0/44ms3736 KiB
15Wrong answer0/421ms3764 KiB
16Wrong answer0/421ms3736 KiB
17Wrong answer0/423ms3740 KiB