180802025-09-27 21:07:46birozsVölgy (100 pont)python3Time limit exceeded 95/100300ms7120 KiB
N = int(input())
maxszel = 0
T = []
for i in range(N):
    T.append(int(input()))
maxszel = -1
i = 0
while i < N-2 and i + maxszel < N:
    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
base95/100
1Accepted0/016ms3232 KiB
2Accepted0/017ms3088 KiB
3Accepted5/516ms3316 KiB
4Accepted5/516ms3116 KiB
5Accepted5/517ms2944 KiB
6Accepted5/516ms3108 KiB
7Accepted5/516ms2996 KiB
8Accepted5/516ms3012 KiB
9Accepted5/5163ms3120 KiB
10Accepted5/517ms3116 KiB
11Accepted5/524ms3120 KiB
12Accepted5/532ms3224 KiB
13Accepted5/532ms3380 KiB
14Accepted5/535ms3380 KiB
15Accepted5/5172ms7120 KiB
16Accepted5/5163ms6932 KiB
17Time limit exceeded0/5300ms7032 KiB
18Accepted5/5186ms7076 KiB
19Accepted5/5166ms6980 KiB
20Accepted5/5170ms6932 KiB
21Accepted5/5170ms7068 KiB
22Accepted5/5180ms7068 KiB