157322025-02-25 12:59:1442Legcsalódottabb versenyző (75 pont)pypy3Runtime error 50/7579ms32000 KiB
N=int(input())
p=tuple(map(int,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/046ms19544 KiB
2Runtime error0/079ms32000 KiB
3Accepted5/541ms19408 KiB
4Accepted5/541ms19488 KiB
5Accepted5/541ms19404 KiB
6Accepted5/541ms19404 KiB
7Accepted5/546ms19360 KiB
8Accepted5/541ms19692 KiB
9Accepted5/546ms19676 KiB
10Accepted5/548ms19572 KiB
11Accepted5/541ms19892 KiB
12Accepted5/541ms19796 KiB
13Runtime error0/579ms32000 KiB
14Runtime error0/578ms32000 KiB
15Runtime error0/570ms32000 KiB
16Runtime error0/568ms32000 KiB
17Runtime error0/579ms32000 KiB