114192024-09-13 10:44:34madvirHőségriadó (50 pont)cpp17Wrong answer 26/5025ms632 KiB
#include <iostream>
#include <set>

using namespace std;
long long n,k,l,f, temp;
long long meleg=0, hideg=0, riado=0, card=0;

int main()
{
    cin >>n >>k >>l >> f;
    for(long long i=0; i<n; i++) {
        cin >> temp;
        if(temp>f) {
            hideg=0;
            meleg++;
            if(meleg==k && riado==0) {
                riado=1;
                card++;
            }
        }
        else {
            meleg=0;
            if(temp<f) {
                hideg++;
                if(hideg==l && riado==1)  {
                    riado=0;
                }
            }
        }
    }
    cout<< card;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base26/50
1Accepted0/03ms420 KiB
2Wrong answer0/025ms632 KiB
3Accepted2/23ms384 KiB
4Accepted2/23ms632 KiB
5Accepted2/22ms364 KiB
6Accepted2/22ms360 KiB
7Accepted2/23ms360 KiB
8Accepted4/43ms376 KiB
9Accepted4/410ms504 KiB
10Accepted4/413ms360 KiB
11Accepted4/416ms296 KiB
12Wrong answer0/413ms396 KiB
13Wrong answer0/419ms232 KiB
14Wrong answer0/44ms492 KiB
15Wrong answer0/423ms376 KiB
16Wrong answer0/423ms360 KiB
17Wrong answer0/423ms360 KiB