90022024-02-11 16:47:23matyiHőségriadó (50 pont)cpp17Wrong answer 18/5024ms3872 KiB
#include <iostream>
#include <fstream>

using namespace std;

int main()
{
    int n,k,l,f;
    ifstream fin("be.in");
    cin>>n>>k>>l>>f;
    int db=1,hosegsz=0,melegsz=0,hidegsz=0,x;
    bool hoseg=false;
    for (int i=1;i<=n;i++)
    {
        cin>>x;
        if (x>f)
        {
            hidegsz=0;
            melegsz++;
            if (!hoseg and melegsz==k)
            {
                hoseg=true;
                hosegsz++;
            }
        }
        else if(x<f)
        {
            hidegsz++;
            melegsz=0;
            if (hoseg and hidegsz==l)
            {
                hoseg=false;
            }
        }

    }
    cout<<hosegsz;

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base18/50
1Accepted0/03ms1720 KiB
2Wrong answer0/024ms1848 KiB
3Accepted2/23ms1932 KiB
4Accepted2/23ms2060 KiB
5Accepted2/23ms2272 KiB
6Accepted2/23ms2516 KiB
7Accepted2/23ms2728 KiB
8Accepted4/43ms2936 KiB
9Accepted4/410ms3128 KiB
10Wrong answer0/413ms3184 KiB
11Wrong answer0/414ms3188 KiB
12Wrong answer0/413ms3312 KiB
13Wrong answer0/419ms3528 KiB
14Wrong answer0/44ms3768 KiB
15Wrong answer0/421ms3872 KiB
16Wrong answer0/421ms3848 KiB
17Wrong answer0/421ms3848 KiB