83102024-01-14 17:06:41TuruTamasVirágos rét (50 pont)cpp17Wrong answer 4/509ms3772 KiB
#include <iostream>

using namespace std;

typedef long long ll;

ll N, K, L, F, a, r;
ll melegnap, hidegnap;
bool riado;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> N >> K >> L >> F;
    for (ll n = 0; n < N; n++) {
        cin >> a;
        if (a >= F) {
            hidegnap = 0;
        }
        if (a <= F) {
            melegnap = 0;
        }
        if (a > F) {
            melegnap++;
            if (!riado && melegnap == K) {
                r++;
                riado = true;
            }
        }
        else if (a < F) {
            hidegnap++;
            if (riado && hidegnap == L) {
                riado = false;
            }
        }
    }
    cout << r << endl;
}
SubtaskSumTestVerdictTimeMemory
base4/50
1Wrong answer0/03ms1888 KiB
2Accepted0/03ms2084 KiB
3Wrong answer0/09ms2168 KiB
4Wrong answer0/23ms2296 KiB
5Accepted2/23ms2516 KiB
6Accepted2/23ms2724 KiB
7Wrong answer0/33ms2848 KiB
8Wrong answer0/33ms3056 KiB
9Wrong answer0/33ms3244 KiB
10Wrong answer0/23ms3476 KiB
11Wrong answer0/33ms3724 KiB
12Wrong answer0/23ms3748 KiB
13Wrong answer0/33ms3772 KiB
14Wrong answer0/28ms3632 KiB
15Wrong answer0/28ms3688 KiB
16Wrong answer0/39ms3692 KiB
17Wrong answer0/39ms3692 KiB
18Wrong answer0/39ms3692 KiB
19Wrong answer0/39ms3756 KiB
20Wrong answer0/39ms3760 KiB
21Wrong answer0/39ms3756 KiB
22Wrong answer0/39ms3756 KiB