179512025-09-24 11:19:18szjHőségriadó (50 pont)cpp17Wrong answer 2/5023ms704 KiB
#include <bits/stdc++.h>

using namespace std;

int main()
{
    //ifstream cin("f.txt");
    int n, l, k, f, m, cn, cl,all=0;
    bool h = 0;
    cin >> n>> k >> l >> f;
    for(int i=1; i<n; i++)
    {
        cin >> m;
        if(!h && m>f)
        {
            h = 1;
            cn=1;
            cl=0;
        }
        else if(h && m>f) cn++;
        else if(h && cn<k && m<=f)h=0;
        else if(h && cn>=k && m<=f)
        {
            cl++;
            if(cl>=l)
            {
                all++;
                h=0;
                cn = 0;
            }
        }
        else if(h && cn>=k && m>f && cl<l)l=0;

    }
    if(cn>0)all++;
    cout << all;

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base2/50
1Accepted0/01ms316 KiB
2Wrong answer0/023ms564 KiB
3Accepted2/21ms316 KiB
4Wrong answer0/21ms316 KiB
5Wrong answer0/21ms316 KiB
6Wrong answer0/21ms316 KiB
7Wrong answer0/21ms316 KiB
8Wrong answer0/41ms316 KiB
9Wrong answer0/49ms316 KiB
10Wrong answer0/412ms564 KiB
11Wrong answer0/414ms596 KiB
12Wrong answer0/412ms564 KiB
13Wrong answer0/417ms636 KiB
14Wrong answer0/43ms316 KiB
15Wrong answer0/420ms700 KiB
16Wrong answer0/420ms704 KiB
17Wrong answer0/420ms704 KiB