183252025-10-20 15:16:50algoproInverziópypy3Runtime error 12/50166ms65536 KiB
# UUID: 23510b0e-f594-4d93-88f5-cbfca60727a9
N = int(input())
A = [(int(x),i) for i,x  in enumerate(input().split())]
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/037ms19444 KiB
2Accepted0/0105ms28252 KiB
3Accepted1/143ms19424 KiB
4Accepted2/245ms21216 KiB
5Accepted7/750ms21224 KiB
6Accepted2/2166ms28180 KiB
7Runtime error0/2123ms65536 KiB
8Runtime error0/2149ms65536 KiB
9Runtime error0/2146ms65536 KiB
10Runtime error0/2128ms65536 KiB
11Runtime error0/2128ms65536 KiB
12Runtime error0/2150ms65536 KiB
13Runtime error0/2149ms65536 KiB
14Runtime error0/2125ms65536 KiB
15Runtime error0/2123ms65536 KiB
16Runtime error0/2148ms65536 KiB
17Runtime error0/2150ms65536 KiB
18Runtime error0/2123ms65536 KiB
19Runtime error0/3128ms65536 KiB
20Runtime error0/3125ms65536 KiB
21Runtime error0/2145ms65536 KiB
22Runtime error0/2125ms65536 KiB
23Runtime error0/2146ms65536 KiB
24Runtime error0/2122ms65536 KiB