111982024-07-16 12:44:4642Bejgli (80 pont)python3Accepted 80/8063ms13924 KiB
from sys import stdin
input = stdin.readline

def main():
    N = int(input())
    A = list(map(int,input().split()))
    d = {}
    for a in A:
        d[a]=d.get(a,0)+1
    db=0
    maxi=0
    count=0
    for a in d:
        x=d[a]//a
        db+=x
        if x>count:
            maxi=a
            count=x
        
    print(db)
    print(maxi)

main()
SubtaskSumTestVerdictTimeMemory
base80/80
1Accepted0/018ms2988 KiB
2Accepted0/017ms2960 KiB
3Accepted4/417ms2952 KiB
4Accepted4/417ms2916 KiB
5Accepted4/418ms3048 KiB
6Accepted4/417ms2916 KiB
7Accepted4/417ms3052 KiB
8Accepted4/417ms2916 KiB
9Accepted4/417ms3080 KiB
10Accepted4/417ms3044 KiB
11Accepted4/419ms3236 KiB
12Accepted4/418ms3192 KiB
13Accepted4/420ms3556 KiB
14Accepted4/421ms3812 KiB
15Accepted4/425ms4216 KiB
16Accepted4/425ms3604 KiB
17Accepted4/435ms6600 KiB
18Accepted4/448ms4768 KiB
19Accepted4/461ms12716 KiB
20Accepted4/459ms13276 KiB
21Accepted4/463ms13924 KiB
22Accepted4/454ms8940 KiB