112672024-08-03 09:54:19probaLegcsalódottabb versenyző (75 pont)python3Accepted 75/7575ms14756 KiB
#N = 10; sor = list(map(int, '2 5 3 8 2 5 4 9 8 9'.split(' ')))
N = int(input()); sor = list(map(int, input().split(' ')))

if sor.index(max(sor)) == 0:
    print(-1)
else:
    for i in range(len(sor)):
        if i == 0:
            csp, eddigmaxp, cshossz = 0, 0, 0
        else:
            if sor[i] > sor[eddigmaxp]:
                if cshossz < i-eddigmaxp:
                    cshossz = i-eddigmaxp; csp = eddigmaxp
                    eddigmaxp = i                    
                else:
                    eddigmaxp = i
    print(csp+1)                
            
    
                
        
        
    
SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/017ms2960 KiB
2Accepted0/070ms14564 KiB
3Accepted5/517ms2960 KiB
4Accepted5/517ms2960 KiB
5Accepted5/517ms2920 KiB
6Accepted5/518ms2888 KiB
7Accepted5/517ms3052 KiB
8Accepted5/517ms3192 KiB
9Accepted5/517ms3044 KiB
10Accepted5/517ms3088 KiB
11Accepted5/519ms3028 KiB
12Accepted5/517ms3044 KiB
13Accepted5/571ms14408 KiB
14Accepted5/571ms14576 KiB
15Accepted5/574ms14756 KiB
16Accepted5/571ms14696 KiB
17Accepted5/575ms14564 KiB