86572024-01-25 00:47:18KezdőHőségriadó (50 pont)python3Accepted 50/5085ms30792 KiB
N,K,L,F = [int(i) for i in input().split()]
H = [int(i) for i in input().split()]

el = 0
le = 0
db = 0
riado = False
for h in H:
    if h > F:
        el += 1
        le = 0
        if el >= K and not riado:
            riado = True
            db += 1
    elif h < F:
        le += 1
        el = 0
        if le >= L and riado:
            riado = False
    else:
        el = 0
        le = 0

print(db)
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/017ms11244 KiB
2Accepted0/085ms28000 KiB
3Accepted2/217ms11820 KiB
4Accepted2/217ms11812 KiB
5Accepted2/217ms12164 KiB
6Accepted2/217ms11944 KiB
7Accepted2/217ms12276 KiB
8Accepted4/418ms12688 KiB
9Accepted4/443ms19528 KiB
10Accepted4/452ms21272 KiB
11Accepted4/457ms23632 KiB
12Accepted4/448ms21680 KiB
13Accepted4/468ms26940 KiB
14Accepted4/421ms14592 KiB
15Accepted4/475ms29936 KiB
16Accepted4/475ms30424 KiB
17Accepted4/478ms30792 KiB