183232025-10-20 15:13:23algoproInverziópypy3Runtime error 12/50172ms65536 KiB
# UUID: e3931d3a-8c3c-435d-bf16-298d93087b03
N = int(input())
A = [int(x) for x in input().split()]
B = [(A[i],i) for i in range(N)]
B.sort()
#print(A)
#print(B)

a=b=0
leghatso=0
for i in range(N):
    cur,index=B[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/043ms19424 KiB
2Accepted0/094ms26036 KiB
3Accepted1/139ms19444 KiB
4Accepted2/252ms21184 KiB
5Accepted7/743ms21188 KiB
6Accepted2/2172ms26428 KiB
7Runtime error0/2145ms65536 KiB
8Runtime error0/2129ms65536 KiB
9Runtime error0/2130ms65536 KiB
10Runtime error0/2153ms65536 KiB
11Runtime error0/2152ms65536 KiB
12Runtime error0/2153ms65536 KiB
13Runtime error0/2128ms65536 KiB
14Runtime error0/2129ms65536 KiB
15Runtime error0/2125ms65536 KiB
16Runtime error0/2150ms65536 KiB
17Runtime error0/2148ms65536 KiB
18Runtime error0/2128ms65536 KiB
19Runtime error0/3145ms65536 KiB
20Runtime error0/3146ms65536 KiB
21Runtime error0/2145ms65536 KiB
22Runtime error0/2128ms65536 KiB
23Runtime error0/2128ms65536 KiB
24Runtime error0/2143ms65536 KiB