問題一覧 > 通常問題

No.266 Aim for the Final Evolution

レベル : / AI推定難易度 : 1075 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 79
作問者 : yuppe19 😺
お気に入りにしたユーザー ProblemId : 596 / 自分の提出
問題文最終更新日: 2026-06-25 01:57:37
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 117 (順位表) の他の問題:

Problem Statement

$P$ is playing a certain social game.
This problem is about enhancing and evolving the cards used in the game.

A card of a certain character evolves $N$ times before reaching its final form.
A card evolves when a material is used on it in [Evolution Synthesis].
The material required for one evolution is one card of that character in its unevolved form.

Cards also have latent abilities, and a card in the $k$-th evolution state has $S_{k}$ latent abilities.
Latent abilities can be [Awakened] by [Enhancement Synthesis], using a card in the same evolution state as the material.
The number of newly [Awakened] latent abilities is the total number of latent abilities currently [Awakened] on the card used as the material, plus $1$.
However, if as a result of [Enhancement Synthesis] the number of [Awakened] latent abilities would exceed the maximum number of latent abilities that can be [Awakened] in that form, it becomes that maximum number.

On evolution, the card moves up to the next form with the number of its [Awakened] latent abilities neither increased nor decreased.
Note that even if the card used as the material for evolution has some latent abilities [Awakened],
[Evolution Synthesis] does not newly [Awaken] any latent abilities.

Given the above, and assuming that the only cards obtainable in the game are cards in the unevolved form with no latent abilities [Awakened],
find the minimum number of cards that must be obtained to create a card in the final form,
for each number of [Awakened] latent abilities of the final form.




Input

$N$
$S_{0}\ S_{1}\ ...\ S_{N}$

$N$ is a non-negative integer. $S_{k} (0 \le k \le N)$ are also non-negative integers.
$0 \le N \le 10$
$0 \le S_{0} \le S_{1} \le ... \le S_{N} \le 10$

Output

Output the number of cards required to reach the final state, for each case from no latent abilities awakened to all awakened (that is, $S_{N}+1$ values), in ascending order of the number awakened, separated by spaces.
After the last number, print a newline without a trailing space.

Sample

Sample 1
Input
3
1 3 6 9
Output
4 5 7 8 11 12 14 16 19 20

As an example, we explain $11$, the $5$-th number in the sample output.
With $11$ obtainable cards, a final-form card with $4$ latent abilities [Awakened] can be created.
(1) Unevolved (unawakened) =Enhance=> Unevolved ( $1$ awakened) =Evolve=> $2$-nd form ( $1$ awakened) ... $3枚\times2セット$
(2) Unevolved (unawakened) =Evolve=> $2$-nd form (unawakened) ... $2枚$
(3) Enhance with one set from (1) and (2) => $2$-nd form ( $2$ awakened) =Evolve=> $3$-rd form ( $2$ awakened) ... $1枚$
(4) The remaining set from (1) =Evolve=> $3$-rd form ( $1$ awakened) ... $1$ card
(5) Enhance with (3) and (4) => $3$-rd form ( $4$ awakened) =Evolve=> Final form ( $4$ awakened) ... $1$ card
In total, $3\times2 + 2 + 1 + 1 + 1 = 11$ cards.

Sample 2
Input
3
0 0 0 0
Output
4

Sample 3
Input
4
0 0 0 0 10
Output
5 10 15 20 25 30 35 40 45 50 55

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。