#!/usr/bin/env python3
from collections import Counter
import sys
def main():
N = int(input())
A = [int(x) for x in input().split()]
if N != len(A):
print("N != len(A)")
return
counts = Counter(A).most_common()
for i in range(1, N + 1):
tot = 0
for c in counts:
num = c[1] - c[1] % i
if num == 0:
break
tot += num
print(tot, end=" ")
if __name__ == "__main__":
if len(sys.argv) == 2:
sys.stdin = open(sys.argv[1])
main()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | #!/usr/bin/env python3 from collections import Counter import sys def main(): N = int(input()) A = [int(x) for x in input().split()] if N != len(A): print("N != len(A)") return counts = Counter(A).most_common() for i in range(1, N + 1): tot = 0 for c in counts: num = c[1] - c[1] % i if num == 0: break tot += num print(tot, end=" ") if __name__ == "__main__": if len(sys.argv) == 2: sys.stdin = open(sys.argv[1]) main() |
English