119572024-11-22 07:47:31ruffbrigiHőségriadó (50 pont)cpp11Wrong answer 8/5023ms724 KiB
#include <iostream>

using namespace std;

int main()
{
    int n,k,l,f,h=0,dbk=0,dbl=0;
    bool hr=false;
    /**cout << "n=";**/ cin>>n;
    /**cout << "k=";**/ cin>>k;
    /**cout << "l=";**/ cin>>l;
    /**cout << "f=";**/ cin>>f;
    int a[n];
    for(int i=1;i<=n;i++) cin>>a[i];
    for(int i=1;i<=n;i++)
    {
        if(a[i]>f)
        {
            dbk++;
            if(dbk==k) h++;
        }
        if(h!=0) hr=true;
        if(hr)
        {
            if(a[i]<f)
            {
                 dbl++;
                 if(dbl==l) hr=false;
                  if(hr==false)
                    {
                        dbk=0;
                        dbl=0;
                    }
            }
        }
    }
    cout<<h;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base8/50
1Accepted0/01ms320 KiB
2Wrong answer0/023ms572 KiB
3Accepted2/21ms320 KiB
4Accepted2/21ms320 KiB
5Accepted2/21ms388 KiB
6Wrong answer0/21ms532 KiB
7Accepted2/21ms320 KiB
8Wrong answer0/41ms320 KiB
9Wrong answer0/49ms508 KiB
10Wrong answer0/412ms460 KiB
11Wrong answer0/414ms604 KiB
12Wrong answer0/412ms528 KiB
13Wrong answer0/417ms568 KiB
14Wrong answer0/42ms428 KiB
15Wrong answer0/420ms568 KiB
16Wrong answer0/420ms724 KiB
17Wrong answer0/420ms568 KiB