No.2092 Conjugation
問題文最終更新日: 2022-09-30 18:22:06
English (AI translation)
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 363
(順位表)
の他の問題:
Problem Statement
You are given a weakly decreasing sequence $A_1,A_2,\ldots,A_N$ of length $N$.
Consider the figure (Young diagram) obtained by placing $A_i$ squares in the $i$-th row from the top, as shown in the image.
How many squares are there in the $j$-th column from the left? Find the answer for each $j=1,2,\ldots,A_1$.
Constraints
- $1\le N\le 10^5$
- $1\le A_i\le 10^5$
- $A_1\ge A_2\ge\cdots\ge A_N$
- All input values are integers.
Input
$N$ $A_1$ $A_2$ $\ldots$ $A_N$
Output
Let $B_j$ be the number of squares in column $j$. Output in the following format.
$B_1$ $B_2$ $\ldots$ $B_{A_1}$
Sample
Sample 1
Input
4 4 2 2 1
Output
4 3 1 1
This is the case shown in the image above.
Sample 2
Input
2 10 5
Output
2 2 2 2 2 1 1 1 1 1
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。