157302025-02-25 00:08:48fzs1969Legcsalódottabb versenyző (75 pont)python3Accepted 75/7568ms14648 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
base75/75
1Accepted0/016ms3124 KiB
2Accepted0/068ms14460 KiB
3Accepted5/516ms3072 KiB
4Accepted5/516ms3124 KiB
5Accepted5/514ms3124 KiB
6Accepted5/517ms3124 KiB
7Accepted5/514ms3124 KiB
8Accepted5/516ms2976 KiB
9Accepted5/516ms3076 KiB
10Accepted5/516ms3008 KiB
11Accepted5/517ms3124 KiB
12Accepted5/516ms3240 KiB
13Accepted5/567ms14584 KiB
14Accepted5/564ms14484 KiB
15Accepted5/568ms14648 KiB
16Accepted5/563ms14520 KiB
17Accepted5/565ms14516 KiB