AtCoder Regular Contest 060 review

Link ARC 060 top page Editorial C: Tak and Cards – 高橋君とカード Dynamic programming I could come up only full search using bit operation during the contest. But it can be solved by DP. Below is full score (Section 3.3 of editorial) implementation.

D: Digit Sum – 桁和 I came up different approach from editorial. Let $$a_i$$ be $$i$$-th digit with base $$b$$. Then, $$n = \sum_i b^i a_i$$ $$s = f(b, n) = \sum_i a_i$$ applies. If we subtract these equation, we obtain $$n – s = \sum_i (b^i – 1) a_i$$ Both side should be integer, and right hand side […]