84082024-01-15 16:00:48birozsHőségriadó (50 pont)python3Wrong answer 46/5098ms30396 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
base46/50
1Accepted0/018ms10888 KiB
2Accepted0/098ms28124 KiB
3Accepted2/217ms11572 KiB
4Accepted2/217ms11824 KiB
5Wrong answer0/217ms12108 KiB
6Wrong answer0/217ms11968 KiB
7Accepted2/217ms12552 KiB
8Accepted4/418ms12820 KiB
9Accepted4/450ms20004 KiB
10Accepted4/457ms21836 KiB
11Accepted4/467ms23916 KiB
12Accepted4/461ms21728 KiB
13Accepted4/482ms26888 KiB
14Accepted4/424ms14476 KiB
15Accepted4/493ms29616 KiB
16Accepted4/489ms30308 KiB
17Accepted4/490ms30396 KiB