問題一覧 > 通常問題

No.1032 Counting Numbers

レベル : / AI推定難易度 : 130 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 208
作問者 : Taku Hirosawa / テスター : Takenaka
お気に入りにしたユーザー ProblemId : 4245 / 自分の提出
問題文最終更新日: 2020-04-24 21:10:43
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

Problem Statement

You are given a sequence $L$ of length $N$ consisting of natural numbers $L_1$, $L_2$, ..., $L_N$.
For every natural number from $1$ to $M$, output how many times it appears in $L$, following the format below.

[Output Format]
$1$ the number of times 1 appears in $L$
$2$ the number of times 2 appears in $L$
$3$ the number of times 3 appears in $L$
...
$M$ the number of times $M$ appears in $L$

Input

$N$ $M$
$L_1$ $L_2$ ... $L_N$

$1$ ≦ $N$, $M$ ≦ $2$ x $10^5$
$1$ ≦ $L_i$ ≦ $2$ x $10^5$

Output

Output the answer following the format.

Sample

Sample 1
Input
5 4
3 1 4 1 5
Output
1 2
2 0
3 1
4 1

Among 1 to 4, in the given sequence 1 appears 2 times, 2 appears 0 times, 3 appears 1 time, and 4 appears 1 time, so the output is as shown.
5 also appears, but it is ignored because it is not included in 1 to 4.

Sample 2
Input
8 2
9 8 7 6 5 4 3 2
Output
1 0
2 1

Sample 3
Input
11 9
1 7 3 20 50 80 7 5 6 8 8
Output
1 1
2 0
3 1
4 0
5 1
6 1
7 2
8 2
9 0

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