248762026-02-16 10:59:33csicsilla70Völgy (100 pont)python3Wrong answer 50/100284ms7308 KiB
N = int(input())
maxszel = 0
T = []
for i in range(N):
    T.append(int(input()))
tores = False
for i in range(1,N):
    if T[i] > T[i-1]:
        tores = True
        break
if not tores:
    print(-1)
else:
    maxszel = -1
    i = 0
    while i < N-2 and i + maxszel < N:
        if T[i] > T[i+1]:
            maxv = T[i]
            j = i + 1
            while j < N-1 and T[j] < maxv:
                j += 1
                if T[j] > maxv:
                    if j - i > maxszel:
                        maxszel = j - i
                    maxv = T[j]
            if T[j] >= maxv:
                i = j
            else:
                i += 1
        else:
            i += 1
    print(maxszel)
SubtaskSumTestVerdictTimeMemory
base50/100
1Accepted0/016ms3324 KiB
2Wrong answer0/017ms3128 KiB
3Wrong answer0/516ms3124 KiB
4Wrong answer0/516ms3124 KiB
5Wrong answer0/517ms2976 KiB
6Wrong answer0/516ms2980 KiB
7Accepted5/514ms2972 KiB
8Accepted5/517ms3060 KiB
9Accepted5/517ms3176 KiB
10Wrong answer0/517ms3124 KiB
11Accepted5/523ms3364 KiB
12Wrong answer0/532ms3168 KiB
13Accepted5/532ms3380 KiB
14Wrong answer0/535ms3380 KiB
15Wrong answer0/5172ms7180 KiB
16Accepted5/5165ms7308 KiB
17Accepted5/5163ms6948 KiB
18Wrong answer0/5167ms6944 KiB
19Time limit exceeded0/5284ms6948 KiB
20Accepted5/5171ms6948 KiB
21Accepted5/5170ms6972 KiB
22Accepted5/5173ms6948 KiB