257612026-03-01 18:11:19algoproBejgli (80 pont)pypy3Wrong answer 0/80108ms36540 KiB
# UUID: 9071b7dd-7413-443e-9cc7-42ea6060cf5a
n = int(input())
a = [int(x) for x in input().split()]
b = a.copy()
db = [0] * (n + 1)
legtöbb = [0]*(n+1)
i = 0
maxi = []
for szam in b:
    legtöbb[szam]+=1
for j in range(1, n+1):
    maxi.append(legtöbb[j] // j)

while i < n:
    x = a[i]
    db[x] += 1
    i += x



print(legtöbb.index(max(maxi)))
print(sum(db))
SubtaskSumTestVerdictTimeMemory
base0/80
1Wrong answer0/043ms19384 KiB
2Wrong answer0/043ms19580 KiB
3Runtime error0/465ms22700 KiB
4Runtime error0/465ms22724 KiB
5Runtime error0/475ms22772 KiB
6Runtime error0/475ms22664 KiB
7Wrong answer0/439ms19664 KiB
8Wrong answer0/439ms19692 KiB
9Runtime error0/467ms22444 KiB
10Wrong answer0/450ms21700 KiB
11Runtime error0/482ms22300 KiB
12Runtime error0/479ms22524 KiB
13Runtime error0/471ms22760 KiB
14Wrong answer0/450ms21896 KiB
15Runtime error0/482ms24088 KiB
16Runtime error0/487ms24748 KiB
17Runtime error0/482ms27112 KiB
18Wrong answer0/474ms35784 KiB
19Wrong answer0/486ms36040 KiB
20Runtime error0/4108ms36524 KiB
21Runtime error0/494ms36540 KiB
22Runtime error0/494ms36336 KiB