83862024-01-15 12:13:22birozsHőségriadó (50 pont)python3Wrong answer 26/5083ms30760 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
            hoseg = 0
    elif T[i] < f:
        hideg += 1
        hoseg = 0
        if riado and hideg == l:
            riado = False
            hideg = 0
    else:
        hoseg = 0
print(rendel)

    
SubtaskSumTestVerdictTimeMemory
base26/50
1Accepted0/018ms11240 KiB
2Wrong answer0/083ms28228 KiB
3Accepted2/217ms11584 KiB
4Accepted2/217ms12036 KiB
5Accepted2/217ms11892 KiB
6Accepted2/217ms12432 KiB
7Accepted2/218ms12564 KiB
8Accepted4/419ms12356 KiB
9Accepted4/445ms20016 KiB
10Accepted4/452ms21524 KiB
11Accepted4/457ms23920 KiB
12Wrong answer0/452ms21944 KiB
13Wrong answer0/470ms27444 KiB
14Wrong answer0/423ms14756 KiB
15Wrong answer0/479ms30016 KiB
16Wrong answer0/478ms30660 KiB
17Wrong answer0/479ms30760 KiB