196152025-12-17 10:51:33gkataHőségriadó (50 pont)cpp17Wrong answer 14/5026ms572 KiB


// hosegriado.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

#include <iostream>
#include <queue>
#define ll long long

using namespace std;

bool ok = false;
ll k, l, f, n, i, a, db1, db2, db;

int main()
{
    cin >> n >> k >> l >> f;

    for (i = 1; i <= n; ++i)
    {
        cin >> a;
        
        if (a > f && !ok)
        {
            ++db1;
            if (db1 == k)
            {
                ok = true;
                ++db;
                db2 = 0;
            }
        }

        if (a < f && ok)
        {
            ++db2;
            if (db2 == l)
            {
                ok = false;
                db1 = 0;
            }
        }
    }
    cout << db;

}

// Run program: Ctrl + F5 or Debug > Start Without Debugging menu
// Debug program: F5 or Debug > Start Debugging menu

// Tips for Getting Started: 
//   1. Use the Solution Explorer window to add/manage files
//   2. Use the Team Explorer window to connect to source control
//   3. Use the Output window to see build output and other messages
//   4. Use the Error List window to view errors
//   5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project
//   6. In the future, to open this project again, go to File > Open > Project and select the .sln file
SubtaskSumTestVerdictTimeMemory
base14/50
1Accepted0/01ms316 KiB
2Wrong answer0/023ms564 KiB
3Accepted2/21ms500 KiB
4Accepted2/21ms316 KiB
5Wrong answer0/21ms316 KiB
6Wrong answer0/21ms508 KiB
7Accepted2/21ms316 KiB
8Accepted4/42ms500 KiB
9Accepted4/49ms392 KiB
10Wrong answer0/413ms364 KiB
11Wrong answer0/414ms572 KiB
12Wrong answer0/412ms500 KiB
13Wrong answer0/417ms400 KiB
14Wrong answer0/43ms500 KiB
15Wrong answer0/426ms396 KiB
16Wrong answer0/420ms404 KiB
17Wrong answer0/421ms396 KiB