Logo
(追記) (追記ここまで)

15135번 - Equal Numbers 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
3 초 512 MB93413449.275%

문제

You are given a list of n integers a1, . . . , an. You can perform the following operation: choose some ai and multiply it by any positive integer.

Your task is to compute the minimum number of different integers that could be on the list after k operations for all 0 ≤ k ≤ n.

입력

The first line of the input contains single integer n (1 ≤ n ≤ 3·105). The second line of the input contains n integers ai (1 ≤ ai ≤ 106).

출력

Output a single line that contains n + 1 integers. The i-th integer should be the minimum possible number of different integers in the list after i − 1 operations.

제한

예제 입력 1

6
3 4 1 2 1 2

예제 출력 1

4 4 3 3 2 2 1

힌트

출처

ICPC > Regionals > Northern Eurasia > Northwestern Russia Regional Contest > NEERC Northern Subregional 2017 E번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /