110272024-06-21 12:00:12CsongiHőségriadó (50 pont)cpp17Wrong answer 0/5024ms512 KiB
#include <iostream>

using namespace std;

int main()
{
    long long N, K, L, F, temp, riadok;
    long long meleg, hideg;
    bool riado;
    cin >> N >> K >> L >> F;
    for (long long n = 0; n < N; n++) 
    {
        cin >> temp;
        if (temp >= F) 
        {
            hideg = 0;
        }
        if (temp <= F) 
        {
            meleg = 0;
        }
        if (temp > F) 
        {
            meleg++;
            if (!riado && meleg == K) 
            {
                riadok++;
                riado = true;
            }
        }
        else if (temp < F) {
            hideg++;
            if (riado && hideg == L) 
            {
                riado = false;
            }
        }
    }
    cout << riadok << endl;
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Wrong answer0/03ms396 KiB
2Wrong answer0/024ms384 KiB
3Wrong answer0/23ms356 KiB
4Wrong answer0/23ms356 KiB
5Wrong answer0/23ms356 KiB
6Wrong answer0/23ms512 KiB
7Wrong answer0/23ms400 KiB
8Wrong answer0/43ms376 KiB
9Wrong answer0/410ms356 KiB
10Wrong answer0/414ms356 KiB
11Wrong answer0/414ms364 KiB
12Wrong answer0/413ms384 KiB
13Wrong answer0/419ms384 KiB
14Wrong answer0/44ms256 KiB
15Wrong answer0/421ms376 KiB
16Wrong answer0/421ms256 KiB
17Wrong answer0/423ms492 KiB