84232024-01-15 22:14:32eokorHőségriadó (50 pont)cpp17Wrong answer 10/5026ms4504 KiB
#include <iostream>
#include <vector>

using namespace std;

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


    for(long long int i=0;i<n;i++)
        {
            cin>>x;
            a.push_back(x);
        }

    for(long long int i=0;i<n;i++)
    {
        if(pont){
                if(a[i]>=h)
                    akt++;
                else akt=0;

                if(akt==k)
                {
                    pont=false;
                    db++;
                    akt=0;
                }

            }
        else if(!pont){

            if(a[i]<h)
                    aktl++;
                else aktl=0;

            if(aktl==l)
                {
                    pont=true;
                    akt=0;
                }
            }

    }
    cout<<db;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base10/50
1Accepted0/03ms1812 KiB
2Wrong answer0/026ms3060 KiB
3Wrong answer0/23ms2144 KiB
4Wrong answer0/23ms2388 KiB
5Accepted2/23ms2568 KiB
6Accepted2/22ms2652 KiB
7Accepted2/23ms2780 KiB
8Wrong answer0/43ms3032 KiB
9Wrong answer0/412ms3712 KiB
10Wrong answer0/414ms3840 KiB
11Wrong answer0/416ms3952 KiB
12Wrong answer0/414ms4168 KiB
13Wrong answer0/420ms4488 KiB
14Accepted4/44ms3556 KiB
15Wrong answer0/423ms4504 KiB
16Wrong answer0/424ms4496 KiB
17Wrong answer0/424ms4496 KiB