84072024-01-15 15:59:16birozsHőségriadó (50 pont)python3Runtime error 0/5018ms13736 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
        if hoseg == k and not(riado):
            riado = True
            rendel += 1
            hoseg = 0
            hideg = 0
    if T[i] < f:
        hideg += 1
        if riado and hideg == l:
            riado = False
            hideg = 0
            hoseg = 0
    if T[i] == f:
        hoseg = 0
        hideg = 0
print(rendel)

    
SubtaskSumTestVerdictTimeMemory
base0/50
1Runtime error0/018ms11204 KiB
2Runtime error0/018ms11232 KiB
3Runtime error0/217ms11600 KiB
4Runtime error0/218ms11916 KiB
5Runtime error0/218ms11920 KiB
6Runtime error0/217ms12208 KiB
7Runtime error0/217ms12444 KiB
8Runtime error0/418ms12268 KiB
9Runtime error0/417ms12372 KiB
10Runtime error0/417ms12648 KiB
11Runtime error0/417ms12900 KiB
12Runtime error0/418ms12576 KiB
13Runtime error0/417ms13040 KiB
14Runtime error0/417ms13224 KiB
15Runtime error0/417ms13384 KiB
16Runtime error0/418ms13736 KiB
17Runtime error0/417ms13728 KiB