136252025-01-08 11:33:05kongopongHőségriadó (50 pont)cpp17Wrong answer 14/5021ms796 KiB
#include <iostream>
#include <vector>

using namespace std;

int main()
{
    int n, k, l, f;
    vector <int> v;
    cin >> n >> k >> l >> f;
    v.resize(n);
    int x, mk=k, ml=l, db=0;
    for(int i=1; i<=n; i++)
    {
        cin >> x;
        v[i-1]=x;
        if(x>f && mk!=-1)
            mk--;
        if(x>f && ml==l && mk==0)
        {
            db++;
            mk=-1;
        }
        if(x<f && mk==-1)
        {
            ml--;
            if(ml==0)
            {
                ml=l;
                mk=k;
            }
        }
        if(x>f && ml!=0 && mk==-1)
        {
            ml=l;
        }
    }
    cout << db;

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base14/50
1Accepted0/01ms328 KiB
2Wrong answer0/021ms564 KiB
3Accepted2/21ms316 KiB
4Accepted2/21ms316 KiB
5Wrong answer0/21ms316 KiB
6Wrong answer0/21ms316 KiB
7Accepted2/21ms324 KiB
8Accepted4/41ms512 KiB
9Accepted4/48ms580 KiB
10Wrong answer0/412ms564 KiB
11Wrong answer0/414ms796 KiB
12Wrong answer0/412ms756 KiB
13Wrong answer0/417ms564 KiB
14Wrong answer0/43ms424 KiB
15Wrong answer0/420ms564 KiB
16Wrong answer0/419ms564 KiB
17Wrong answer0/420ms564 KiB