Official

C - ℕ Coloring Editorial by evima


For example, \(A_i= (\text{the number of prime factors of } i) + 1\) achieves the objective.

Two numbers such that one divides the other have different numbers of prime factors, so all conditions are satisfied.

Let \(2^k\) be the greatest power of \(2\) less than or equal to \(N\). Then, \(A_1,A_2,A_4\ldots,A_{2^{k-1}},A_{2^k}\) must be distinct, so the greatest value in \(A\) has to be at least \(k + 1\). In our choice of \(A\) above, the gratest value is \(k + 1\), too, so it is optimal.

posted:
last update: