180792025-09-27 20:56:35birozsVölgy (100 pont)python3Time limit exceeded 85/100300ms7096 KiB
N = int(input())
maxszel = 0
T = []
for i in range(N):
    T.append(int(input()))
maxszel = -1
i = 0
while i < N-2:
    if T[i] > T[i+1]:
        maxv = T[i+1]
        j = i + 1
        while j < N-1 and T[j] < T[i]:
            j += 1
            if T[j] > maxv:
                if j - i > maxszel:
                    maxszel = j - i
                maxv = T[j]
        if T[j] >= T[i]:
            i = j
        else:
            i += 1
    else:
        i += 1
print(maxszel)


SubtaskSumTestVerdictTimeMemory
base85/100
1Accepted0/014ms3124 KiB
2Accepted0/017ms3124 KiB
3Accepted5/516ms3124 KiB
4Accepted5/516ms3124 KiB
5Accepted5/516ms3128 KiB
6Accepted5/516ms3124 KiB
7Accepted5/516ms3344 KiB
8Accepted5/516ms3140 KiB
9Accepted5/5167ms3136 KiB
10Accepted5/517ms3124 KiB
11Accepted5/524ms3280 KiB
12Accepted5/530ms3248 KiB
13Accepted5/532ms3484 KiB
14Accepted5/537ms3324 KiB
15Accepted5/5172ms6932 KiB
16Accepted5/5187ms6908 KiB
17Time limit exceeded0/5300ms6916 KiB
18Accepted5/5187ms6940 KiB
19Time limit exceeded0/5284ms6980 KiB
20Accepted5/5172ms6920 KiB
21Time limit exceeded0/5284ms6948 KiB
22Accepted5/5177ms7096 KiB