114142024-09-13 10:34:29szabelrHőségriadó (50 pont)cpp17Wrong answer 14/5025ms1148 KiB
#include <iostream>

using namespace std;

int main()
{
    long long n,k,l,f,a[100001],atlag=0,riadoe=0,riadok=0;
    cin>>n>>k>>l>>f;
    for(int i=1; i<=n; i++)
    {
        cin>>a[i];
        if(riadoe==0)
        {
            if(a[i]>f)
                atlag++;
            if(atlag==k){
                atlag=0;
                riadok++;
                riadoe=1;
                //cout<<i<<endl;
            }
        }
        if(riadoe==1)
        {
            if(a[i]<f)
                atlag++;
            if(atlag==l){
                atlag=0;
                //riadok++;
                riadoe=0;
            }
        }
    }
    cout<<riadok;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base14/50
1Accepted0/02ms360 KiB
2Wrong answer0/025ms1128 KiB
3Accepted2/23ms508 KiB
4Accepted2/23ms472 KiB
5Wrong answer0/22ms364 KiB
6Wrong answer0/23ms360 KiB
7Accepted2/23ms512 KiB
8Accepted4/43ms360 KiB
9Accepted4/412ms756 KiB
10Wrong answer0/414ms744 KiB
11Wrong answer0/416ms876 KiB
12Wrong answer0/413ms836 KiB
13Wrong answer0/419ms796 KiB
14Wrong answer0/44ms232 KiB
15Wrong answer0/423ms1120 KiB
16Wrong answer0/423ms1128 KiB
17Wrong answer0/423ms1148 KiB