183292025-10-20 15:30:48algoproInverziópypy3Accepted 50/501.715s95588 KiB
# UUID: 25b1df4c-da63-4325-97d6-6e1747e0b9b5
N = int(input())
A = sorted([(int(x),i) for i,x  in enumerate(input().split())])

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
base50/50
1Accepted0/039ms19608 KiB
2Accepted0/0105ms28636 KiB
3Accepted1/137ms19400 KiB
4Accepted2/250ms21128 KiB
5Accepted7/745ms21204 KiB
6Accepted2/2175ms28452 KiB
7Accepted2/2565ms95400 KiB
8Accepted2/21.71s95476 KiB
9Accepted2/21.715s95476 KiB
10Accepted2/21.598s95488 KiB
11Accepted2/21.516s95476 KiB
12Accepted2/21.644s94772 KiB
13Accepted2/21.526s95504 KiB
14Accepted2/21.616s95472 KiB
15Accepted2/2560ms95484 KiB
16Accepted2/21.567s95472 KiB
17Accepted2/21.601s95352 KiB
18Accepted2/21.674s95588 KiB
19Accepted3/3606ms95448 KiB
20Accepted3/3601ms95476 KiB
21Accepted2/2574ms95544 KiB
22Accepted2/21.567s95464 KiB
23Accepted2/21.503s95472 KiB
24Accepted2/2246ms95472 KiB