204472026-01-06 18:44:42SomogyiHőségriadó (50 pont)cpp17Wrong answer 4/5020ms552 KiB
#include <iostream>
using namespace std;

int main()
{
    int n, K, L, F;
    cin >> n >> K >> L >> F;

    int x;
    int db1 = 0, db2 = 0, hoseg = 0;
    bool riado = false;

    for (int i = 0; i < n; i++)
    {
        cin >> x;

        if (x >= F)
        {
            db1++;
            db2 = 0;
        }
        else
        {
            db1++;
            db2 = 0;
        }

        if (db1 == K && !riado)
        {
            hoseg++;
            riado = true;
        }

        if ((L > 0 && db2 == L) || (L == 0 && x < F))
        {
            riado = false;
        }
    }

    cout << hoseg;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base4/50
1Wrong answer0/01ms316 KiB
2Wrong answer0/020ms316 KiB
3Wrong answer0/21ms316 KiB
4Wrong answer0/21ms316 KiB
5Accepted2/21ms316 KiB
6Wrong answer0/21ms368 KiB
7Accepted2/21ms316 KiB
8Wrong answer0/41ms552 KiB
9Wrong answer0/48ms508 KiB
10Wrong answer0/410ms404 KiB
11Wrong answer0/413ms500 KiB
12Wrong answer0/410ms400 KiB
13Wrong answer0/417ms392 KiB
14Wrong answer0/42ms316 KiB
15Wrong answer0/419ms400 KiB
16Wrong answer0/419ms396 KiB
17Wrong answer0/419ms400 KiB