157342025-02-25 13:05:1242Legcsalódottabb versenyző (75 pont)pypy3Runtime error 50/7582ms32000 KiB
N=int(input())
p=tuple(int(x) for x in input().split())
aktmaxérték,aktmaxhely,aktmaxdb=0,-1,0
gmaxérték,gmaxhely,gmaxdb=0,-1,0
for i in range(N):
    if p[i] > aktmaxérték:
        if aktmaxdb > gmaxdb:
            gmaxérték, gmaxhely, gmaxdb = aktmaxérték, aktmaxhely, aktmaxdb
        aktmaxdb = 0
        aktmaxérték = p[i]
        aktmaxhely = i
    aktmaxdb += 1

if p[0] >= max(p):
    print(-1)
else:
    print(gmaxhely + 1)
SubtaskSumTestVerdictTimeMemory
base50/75
1Accepted0/046ms19320 KiB
2Runtime error0/074ms32000 KiB
3Accepted5/545ms19528 KiB
4Accepted5/541ms19428 KiB
5Accepted5/546ms19432 KiB
6Accepted5/541ms19540 KiB
7Accepted5/546ms19500 KiB
8Accepted5/541ms19692 KiB
9Accepted5/546ms19780 KiB
10Accepted5/541ms19784 KiB
11Accepted5/541ms19784 KiB
12Accepted5/550ms21224 KiB
13Runtime error0/582ms32000 KiB
14Runtime error0/582ms32000 KiB
15Runtime error0/572ms32000 KiB
16Runtime error0/571ms32000 KiB
17Runtime error0/582ms32000 KiB