157662025-02-26 13:59:07RozsvaiMonikaLegcsalódottabb versenyző (75 pont)python3Runtime error 0/75266ms11956 KiB
pontokszáma = input()
pontokszáma = int(pontokszáma)
pontok = input() 
pontok = pontok.strip().split()
for i in range(pontokszáma):
    pontok[i] = int(pontok[i])
# pontok = [2, 5, 8, 2, 5, 4, 9, 8, 9]
# pontok = [2, 5, 3, 8, 2, 5, 4, 9, 8, 9]
pontokszáma = len(pontok)
sorozat = [0] * pontokszáma
max = 0 
sorszám = 0
for i in range(pontokszáma):
    sorozat[i] = sorszám
    if pontok[i] > max:
        max = pontok[i]
        sorszám = sorszám + 1
#print(pontok)
#print(sorozat)

maxdarab = 0
for j in range(sorszám):
    darab = 0
    for i in range(pontokszáma):
        if sorozat[i] == j:
            darab = darab + 1
    if darab > maxdarab:
        maxdarab = darab
        maxsorszám = j
#print(maxdarab, maxsorszám)

darab = 0
for j in range(pontokszáma):
    if sorozat [j] < maxsorszám:
        darab = darab + 1
if pontok [0]>= max(pontok):
    prinz(-1)
else:
    print(darab)



SubtaskSumTestVerdictTimeMemory
base0/75
1Runtime error0/016ms3308 KiB
2Time limit exceeded0/0252ms11956 KiB
3Runtime error0/517ms3116 KiB
4Runtime error0/516ms3124 KiB
5Runtime error0/517ms3128 KiB
6Runtime error0/514ms3168 KiB
7Runtime error0/516ms2936 KiB
8Runtime error0/517ms3124 KiB
9Runtime error0/517ms3120 KiB
10Runtime error0/517ms3036 KiB
11Runtime error0/517ms3564 KiB
12Runtime error0/517ms3124 KiB
13Time limit exceeded0/5266ms11556 KiB
14Time limit exceeded0/5236ms11444 KiB
15Time limit exceeded0/5223ms11600 KiB
16Time limit exceeded0/5226ms11592 KiB
17Time limit exceeded0/5214ms11640 KiB