257592026-03-01 17:54:27algoproBejgli (80 pont)pypy3Runtime error 22/80107ms35844 KiB
# UUID: 77786f8e-82ac-4249-a464-5d7d249c33e1
n = int(input())
a = [int(x) for x in input().split()]
szelet = 0
db = [0] * (n + 1)
legtöbb = [0]*(n+1)
akt = 1
i = 0
maxi = []
while i < n:
    x = a[i]
    db[x] += 1
    i += x
osszes = sum(db)
print(osszes)

for szam in a:
    legtöbb[szam]+=1
for i in range(1, n+1):
    maxi.append(legtöbb[i] // i)
print(legtöbb.index(max(maxi)))
SubtaskSumTestVerdictTimeMemory
base22/80
1Accepted0/039ms19624 KiB
2Accepted0/043ms19584 KiB
3Runtime error0/472ms22748 KiB
4Runtime error0/464ms22712 KiB
5Runtime error0/467ms22760 KiB
6Runtime error0/472ms22704 KiB
7Accepted4/439ms19540 KiB
8Accepted4/439ms19776 KiB
9Runtime error0/475ms22508 KiB
10Accepted4/450ms21736 KiB
11Runtime error0/470ms22560 KiB
12Runtime error0/483ms23564 KiB
13Runtime error0/474ms23596 KiB
14Accepted4/450ms21712 KiB
15Runtime error0/483ms23776 KiB
16Runtime error0/487ms24552 KiB
17Runtime error0/482ms26856 KiB
18Accepted4/474ms34992 KiB
19Partially correct2/482ms35052 KiB
20Runtime error0/494ms35840 KiB
21Runtime error0/497ms35844 KiB
22Runtime error0/4107ms35520 KiB