196212025-12-17 11:31:53gkataHőségriadó (50 pont)cpp17Hibás válasz 14/5023ms568 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;
            db2 = 0;
            if (db1 == k)
            {
                ok = true;
                ++db;
            }
        }

        if (a < f && ok)
        {
            ++db2;
            db1 = 0;
            if (db2 == l) ok = false;
        }
    }
    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
RészfeladatÖsszpontTesztVerdiktIdőMemória
base14/50
1Elfogadva0/02ms316 KiB
2Hibás válasz0/023ms508 KiB
3Elfogadva2/21ms316 KiB
4Elfogadva2/21ms500 KiB
5Hibás válasz0/21ms316 KiB
6Hibás válasz0/21ms316 KiB
7Elfogadva2/21ms316 KiB
8Elfogadva4/41ms316 KiB
9Elfogadva4/49ms316 KiB
10Hibás válasz0/412ms332 KiB
11Hibás válasz0/414ms568 KiB
12Hibás válasz0/412ms400 KiB
13Hibás válasz0/417ms508 KiB
14Hibás válasz0/43ms396 KiB
15Hibás válasz0/420ms316 KiB
16Hibás válasz0/420ms396 KiB
17Hibás válasz0/421ms396 KiB