257622026-03-01 18:19:52algoproBejgli (80 pont)pypy3Wrong answer 0/8081ms31896 KiB
# UUID: 2662a6e4-4bee-4af0-b7d1-7cfe2f4f8cb4
n = int(input())
a = [int(x) for x in input().split()]
db = [0]*(n+1)
legtöbb = [0]*(n+1)

for szam in a:
    if szam <= n:
        legtöbb[szam] += 1

egy = -1
kettő = []
for j in range(1, n+1):
    egybe = legtöbb[j] // j
    
    if egybe > egy:
        egy = egybe
        kettő = [j]
    elif egybe == egy:
        kettő.append(j)
i = 0
while i < n:
    x = a[i]
    if x <= 0:
        break
    db[x] += 1
    i += x
print(*sorted(kettő))
print(sum(db))
SubtaskSumTestVerdictTimeMemory
base0/80
1Wrong answer0/043ms19440 KiB
2Wrong answer0/039ms19564 KiB
3Wrong answer0/439ms19460 KiB
4Wrong answer0/439ms19436 KiB
5Wrong answer0/446ms19468 KiB
6Wrong answer0/439ms19528 KiB
7Wrong answer0/446ms19736 KiB
8Wrong answer0/439ms19944 KiB
9Wrong answer0/450ms21184 KiB
10Wrong answer0/457ms21788 KiB
11Wrong answer0/450ms21808 KiB
12Wrong answer0/450ms21748 KiB
13Wrong answer0/457ms21736 KiB
14Wrong answer0/452ms21856 KiB
15Wrong answer0/450ms21808 KiB
16Wrong answer0/461ms22820 KiB
17Wrong answer0/459ms25932 KiB
18Wrong answer0/479ms31444 KiB
19Wrong answer0/481ms31796 KiB
20Wrong answer0/478ms31704 KiB
21Wrong answer0/470ms31896 KiB
22Wrong answer0/478ms31464 KiB