199762025-12-30 20:03:40kissmikkiBejgli (80 pont)python3Wrong answer 0/8059ms14676 KiB
import sys

def szamol(N, Sz):
    szeletek=0
    aktualisSzelet=0
    for i in Sz:
        if aktualisSzelet==0:
            szeletek=szeletek+1
            aktualisSzelet=i
        aktualisSzelet=aktualisSzelet-1
    Sz.sort()
    maxDb=0
    max=0
    elozo=0
    db=0
    for i in Sz:
        if elozo!=0:
            if i==elozo:
                db=db+1
            else:
                hossz=db/elozo
                if hossz>maxDb:
                    maxDb=hossz
                    max=elozo
                db=1
        else:
            db=1
        elozo=i    
    hossz=db/elozo
    if hossz>maxDb:
        maxDb=hossz
        max=elozo
    print(szeletek, max)
    return szeletek, max

def test():
    db, legtobb=szamol(7, [1, 1, 3, 3, 3, 2, 2])
    assert 4==db
    assert 1==legtobb

    db, legtobb=szamol(8, [1, 2, 2, 3, 3, 3, 2, 2])
    assert 4==db
    assert 2==legtobb

def futtat():
    N=int(input())
    Sz=list(map(int, input().split()))
    szamol(N, Sz)

#test()
futtat()
SubtaskSumTestVerdictTimeMemory
base0/80
1Wrong answer0/017ms3192 KiB
2Wrong answer0/016ms3124 KiB
3Wrong answer0/417ms3120 KiB
4Wrong answer0/416ms3320 KiB
5Wrong answer0/417ms3124 KiB
6Wrong answer0/417ms3200 KiB
7Wrong answer0/417ms3112 KiB
8Wrong answer0/417ms3300 KiB
9Wrong answer0/417ms3324 KiB
10Wrong answer0/417ms3124 KiB
11Wrong answer0/417ms3380 KiB
12Wrong answer0/418ms3112 KiB
13Wrong answer0/418ms3824 KiB
14Wrong answer0/419ms3892 KiB
15Wrong answer0/421ms4248 KiB
16Wrong answer0/423ms3656 KiB
17Wrong answer0/439ms6716 KiB
18Wrong answer0/448ms5092 KiB
19Wrong answer0/456ms13236 KiB
20Wrong answer0/454ms13840 KiB
21Wrong answer0/459ms14676 KiB
22Wrong answer0/454ms8812 KiB