157312025-02-25 00:09:46fzs1969Legcsalódottabb versenyző (75 pont)pypy3Runtime error 50/7581ms32000 KiB
N = int(input())
p = list(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/041ms19676 KiB
2Runtime error0/071ms32000 KiB
3Accepted5/545ms19352 KiB
4Accepted5/545ms19416 KiB
5Accepted5/548ms19452 KiB
6Accepted5/546ms19496 KiB
7Accepted5/541ms19388 KiB
8Accepted5/548ms19612 KiB
9Accepted5/541ms19692 KiB
10Accepted5/539ms19692 KiB
11Accepted5/539ms19840 KiB
12Accepted5/550ms21024 KiB
13Runtime error0/568ms32000 KiB
14Runtime error0/579ms32000 KiB
15Runtime error0/579ms32000 KiB
16Runtime error0/581ms32000 KiB
17Runtime error0/579ms32000 KiB