114152024-09-13 10:40:22madvirHőségriadó (50 pont)cpp17Wrong answer 26/5023ms768 KiB
#include <iostream>
#include <set>

using namespace std;

int main()
{
    long long n,k,l,f;
    cin >>n >>k >>l >> f;
    int temp[n];
    int meleg=0, hideg=0, riado=0, card=0;
    for(int i=0; i<n; i++) {
        cin >> temp[i];
        if(temp[i]>f) {
            hideg=0;
            meleg++;
            if(meleg==k && riado==0) {
                riado=1;
                card++;
            }
        }
        else {
            meleg=0;
            if(temp[i]<f) {
                hideg++;
                if(hideg==l && riado==1)  {
                    riado=0;
                }
            }
        }
    }
    cout<< card;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base26/50
1Accepted0/02ms360 KiB
2Wrong answer0/023ms768 KiB
3Accepted2/23ms420 KiB
4Accepted2/23ms396 KiB
5Accepted2/22ms376 KiB
6Accepted2/23ms376 KiB
7Accepted2/23ms360 KiB
8Accepted4/43ms372 KiB
9Accepted4/410ms428 KiB
10Accepted4/413ms488 KiB
11Accepted4/414ms540 KiB
12Wrong answer0/414ms632 KiB
13Wrong answer0/418ms632 KiB
14Wrong answer0/44ms232 KiB
15Wrong answer0/421ms748 KiB
16Wrong answer0/421ms616 KiB
17Wrong answer0/420ms744 KiB