183242025-10-20 15:14:29algoproInverziópypy3Runtime error 12/50173ms65536 KiB
# UUID: 9025c7e8-a329-46e5-aeaf-497adf378616
N = int(input())
A = [int(x) for x in input().split()]
A = [(A[i],i) for i in range(N)]
A.sort()
#print(A)
#print(B)

a=b=0
leghatso=0
for i in range(N):
    cur,index=A[i]
    if index < leghatso:
        if leghatso-index>b-a:
            b=leghatso
            a=index
    leghatso=max(leghatso,index)

if a==b:
    print(-1)
else:
    print(a+1,b+1)
SubtaskSumTestVerdictTimeMemory
base12/50
1Accepted0/043ms19540 KiB
2Accepted0/0103ms26216 KiB
3Accepted1/139ms19340 KiB
4Accepted2/245ms21180 KiB
5Accepted7/750ms21228 KiB
6Accepted2/2173ms26340 KiB
7Runtime error0/2128ms65536 KiB
8Runtime error0/2150ms65536 KiB
9Runtime error0/2129ms65536 KiB
10Runtime error0/2155ms65536 KiB
11Runtime error0/2151ms65536 KiB
12Runtime error0/2136ms65536 KiB
13Runtime error0/2130ms65536 KiB
14Runtime error0/2155ms65536 KiB
15Runtime error0/2152ms65536 KiB
16Runtime error0/2156ms65536 KiB
17Runtime error0/2127ms65536 KiB
18Runtime error0/2150ms65536 KiB
19Runtime error0/3128ms65536 KiB
20Runtime error0/3127ms65536 KiB
21Runtime error0/2150ms65536 KiB
22Runtime error0/2129ms65536 KiB
23Runtime error0/2150ms65536 KiB
24Runtime error0/2128ms65536 KiB