84102024-01-15 16:32:46birozsHőségriadó (50 pont)python3Runtime error 0/5018ms13368 KiB
#n,k,l,f = map(int,input().split())
#T = list(map(int,input().split()))

be = open("be2.txt")
n,k,l,f = map(int,be.readline().split())
T = list(map(int,be.readline().split()))
be.close()
riado = False
hoseg = 0
hideg = 0
rendel = 0
for i in range(n):
    if T[i] > f:
        hoseg += 1
        hideg = 0
        if hoseg == k and not(riado):
            riado = True
            rendel += 1
    if T[i] < f:
        hideg += 1
        hoseg = 0
        if riado and hideg == l:
            riado = False
    if T[i] == f:
        hoseg = 0
        hideg = 0
print(rendel)

    
SubtaskSumTestVerdictTimeMemory
base0/50
1Runtime error0/017ms10996 KiB
2Runtime error0/017ms11340 KiB
3Runtime error0/217ms11712 KiB
4Runtime error0/217ms11792 KiB
5Runtime error0/217ms11832 KiB
6Runtime error0/217ms11900 KiB
7Runtime error0/217ms12360 KiB
8Runtime error0/417ms12644 KiB
9Runtime error0/417ms12752 KiB
10Runtime error0/417ms12860 KiB
11Runtime error0/417ms13156 KiB
12Runtime error0/417ms12868 KiB
13Runtime error0/417ms12728 KiB
14Runtime error0/418ms13368 KiB
15Runtime error0/417ms13192 KiB
16Runtime error0/417ms13152 KiB
17Runtime error0/418ms13060 KiB