232392026-01-16 19:00:38kornelfHőségriadó (50 pont)python3Wrong answer 18/5075ms11764 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/016ms3308 KiB
2Accepted0/075ms11764 KiB
3Accepted2/216ms2860 KiB
4Wrong answer0/216ms3312 KiB
5Wrong answer0/214ms3084 KiB
6Accepted2/214ms3024 KiB
7Accepted2/216ms2952 KiB
8Accepted4/417ms3124 KiB
9Accepted4/443ms6584 KiB
10Wrong answer0/443ms7476 KiB
11Wrong answer0/450ms8508 KiB
12Wrong answer0/443ms7412 KiB
13Wrong answer0/461ms10036 KiB
14Wrong answer0/420ms3636 KiB
15Wrong answer0/468ms11448 KiB
16Wrong answer0/468ms11436 KiB
17Accepted4/471ms11640 KiB