232382026-01-16 19:00:19kornelfHőségriadó (50 pont)pypy3Runtime error 18/5079ms32000 KiB
_, K, L, F = map(int, input().split())
days = list(map(int, input().split()))
isAlerted = False
belowCount = 0
aboveCount = 0
results = 0
for i in days:
    if i == F:
        aboveCount = 0
        belowCount = 0
    elif i < F:
        aboveCount = 0
        belowCount += 1
    elif i > F:
        aboveCount += 1
        belowCount = 0
    if belowCount == K and isAlerted:
        isAlerted = False
    if aboveCount == L and not isAlerted:
        isAlerted = True
        results += 1
print(results)
SubtaskSumTestVerdictTimeMemory
base18/50
1Accepted0/039ms19624 KiB
2Runtime error0/074ms32000 KiB
3Accepted2/243ms19416 KiB
4Wrong answer0/239ms19360 KiB
5Wrong answer0/239ms19400 KiB
6Accepted2/239ms19364 KiB
7Accepted2/246ms19436 KiB
8Accepted4/457ms21460 KiB
9Accepted4/461ms25320 KiB
10Wrong answer0/470ms26664 KiB
11Wrong answer0/464ms28064 KiB
12Wrong answer0/468ms26600 KiB
13Wrong answer0/478ms30200 KiB
14Wrong answer0/456ms21736 KiB
15Wrong answer0/468ms31392 KiB
16Wrong answer0/467ms31476 KiB
17Accepted4/479ms31352 KiB