157712025-02-26 14:03:10SzaboVilmosLegcsalódottabb versenyző (75 pont)python3Runtime error 0/75270ms11952 KiB
pontoksz = input() #("Mi a pontok száma?")
pontoksz = int(pontoksz)
pontok = input() #("add meg a pontszámokat!")
pontok = pontok.strip().split()
for i in range(pontoksz):
    pontok[i] = int(pontok[i])
#pontok = [2, 5, 3, 8, 2, 5, 4, 9, 8, 9]
#pontoksz = len(pontok)
sorozat = [0]*pontoksz
max = 0
sorszám = 0
for i in range(pontoksz):
    sorozat[i]=sorszám
    if pontok[i] > max:
        max = pontok[i]
        sorszám = sorszám+1

#print(sorozat, max)
maxdarab = 0
for j in range(sorszám):    
    darab=0
    for i in range(pontoksz):
        if sorozat[i]==j:
            darab = darab+1
    if darab > maxdarab:
        maxdarab = darab
        maxsorszám = j
darab = 0
for j in range(pontoksz):
    if sorozat[j] < maxsorszám:
        darab=darab+1
if pontok[0] >= max(pontok):
    print ("-1")
else:
     print(darab)
SubtaskSumTestVerdictTimeMemory
base0/75
1Runtime error0/016ms3124 KiB
2Time limit exceeded0/0243ms11952 KiB
3Runtime error0/516ms2932 KiB
4Runtime error0/516ms3124 KiB
5Runtime error0/516ms3124 KiB
6Runtime error0/517ms3124 KiB
7Runtime error0/517ms3084 KiB
8Runtime error0/517ms3156 KiB
9Runtime error0/516ms3124 KiB
10Runtime error0/517ms3184 KiB
11Runtime error0/517ms3128 KiB
12Runtime error0/517ms3264 KiB
13Time limit exceeded0/5270ms11448 KiB
14Time limit exceeded0/5229ms11616 KiB
15Time limit exceeded0/5226ms11640 KiB
16Time limit exceeded0/5224ms11440 KiB
17Time limit exceeded0/5209ms11444 KiB