127602024-12-30 07:58:11birozsInverziópython3Wrong answer 0/5017ms3148 KiB
#N = int(input())
#lista = list(map(int,input().split()))
N = 15
lista = [15,2,3,12,13,11,8,9,10,4,5,7,6,14,1]
maxelter = 0
maxelterpoz = 0
maxertek = 0
for i in range(N):
    if abs(lista[i] - (i+1)) > maxelter:
        maxertek = lista[i]
        maxelter = abs(lista[i] - (i+1))
        maxelterpoz = i+1
if maxelter == 0:
    print(-1)
elif maxertek > maxelterpoz:
    minelterpoz = N
    for i in range(N-1,-1,-1):
        if lista[i] < maxertek:
            minelterpoz = i+1
            break
    print(maxelterpoz,minelterpoz)
else:
    minelterpoz = 1
    for i in range(N):
        if lista[i] > maxertek:
            minelterpoz = i+1
            break
    print(minelterpoz,maxelterpoz)   



SubtaskSumTestVerdictTimeMemory
base0/50
1Wrong answer0/016ms3124 KiB
2Wrong answer0/016ms3128 KiB
3Wrong answer0/116ms3148 KiB
4Wrong answer0/216ms3128 KiB
5Wrong answer0/717ms3128 KiB
6Wrong answer0/216ms3128 KiB
7Wrong answer0/216ms3128 KiB
8Wrong answer0/214ms3088 KiB
9Wrong answer0/217ms3128 KiB
10Wrong answer0/216ms3132 KiB
11Wrong answer0/217ms3128 KiB
12Wrong answer0/214ms3128 KiB
13Wrong answer0/216ms3016 KiB
14Wrong answer0/214ms3100 KiB
15Wrong answer0/216ms3132 KiB
16Wrong answer0/214ms3140 KiB
17Wrong answer0/216ms3128 KiB
18Wrong answer0/216ms3072 KiB
19Wrong answer0/317ms3080 KiB
20Wrong answer0/316ms3128 KiB
21Wrong answer0/214ms3080 KiB
22Wrong answer0/216ms3080 KiB
23Wrong answer0/216ms3128 KiB
24Wrong answer0/216ms3128 KiB