88932024-02-02 22:45:38radocziaronLegmesszebbi rossz sorrendű (35 pont)python3Time limit exceeded 6/35300ms17984 KiB
n = int(input())
lista = list(map(int,input().split()))
i = 0
o = -1
x = 0
y = 0

if lista == sorted(lista):
    print(-1)
else:
    while n-i-1 > o:
        for j in range(n-1,i,-1):
            if lista[j] < lista[i]:
                if j-i > o:
                    o = j-i
                    x = i
                    y = j
                break
        i += 1
    print(x+1,"",y+1)
SubtaskSumTestVerdictTimeMemory
base6/35
1Accepted0/018ms11252 KiB
2Time limit exceeded0/0300ms16236 KiB
3Accepted1/118ms11864 KiB
4Accepted1/117ms11956 KiB
5Accepted1/118ms11988 KiB
6Accepted1/117ms12052 KiB
7Accepted1/118ms12428 KiB
8Accepted1/1107ms12564 KiB
9Time limit exceeded0/1280ms5336 KiB
10Time limit exceeded0/1284ms5556 KiB
11Time limit exceeded0/1280ms5712 KiB
12Time limit exceeded0/2275ms10112 KiB
13Time limit exceeded0/2284ms10692 KiB
14Time limit exceeded0/2259ms11228 KiB
15Time limit exceeded0/2263ms8740 KiB
16Time limit exceeded0/2263ms11360 KiB
17Time limit exceeded0/2252ms13440 KiB
18Time limit exceeded0/2259ms14856 KiB
19Time limit exceeded0/2277ms15132 KiB
20Time limit exceeded0/2263ms16048 KiB
21Time limit exceeded0/2256ms17068 KiB
22Time limit exceeded0/2268ms17984 KiB
23Time limit exceeded0/2280ms17404 KiB
24Time limit exceeded0/2264ms17540 KiB