142352025-01-10 10:08:06markfsibianHőségriadó (50 pont)cpp17Wrong answer 18/5020ms508 KiB
#include <iostream>

using namespace std;

int n, k, l, f, ho, hi, db;
bool hr;
int main()
{
    cin >> n >> k >> l >> f;
    int t;
    for (int i = 1; i <= n; ++i)
    {
        cin >> t;
        if (t > f)
        {
            ho++;
            hi = 0;
        }
        if (t < f)
        {
            hi++;
            ho = 0;
        }
        if (ho == k && !hr)
        {
            hr = true;
            db++;
        }
        else if (hi == l)
            hr = false;
    }
    cout << db;

}

SubtaskSumTestVerdictTimeMemory
base18/50
1Accepted0/01ms316 KiB
2Wrong answer0/020ms500 KiB
3Accepted2/21ms500 KiB
4Accepted2/21ms316 KiB
5Accepted2/21ms316 KiB
6Accepted2/21ms316 KiB
7Accepted2/21ms316 KiB
8Accepted4/41ms500 KiB
9Accepted4/48ms500 KiB
10Wrong answer0/410ms404 KiB
11Wrong answer0/413ms396 KiB
12Wrong answer0/410ms316 KiB
13Wrong answer0/417ms400 KiB
14Wrong answer0/42ms508 KiB
15Wrong answer0/419ms400 KiB
16Wrong answer0/419ms500 KiB
17Wrong answer0/419ms316 KiB