結果

問題 No.1032 数数え
ユーザー kokatsu
提出日時 2022-03-01 22:22:24
言語 D
(dmd 2.109.1)
結果
AC  
実行時間 111 ms / 2,000 ms
コード長 279 bytes
コンパイル時間 2,219 ms
コンパイル使用メモリ 211,172 KB
実行使用メモリ 10,476 KB
最終ジャッジ日時 2024-06-22 14:27:17
合計ジャッジ時間 3,516 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

import std;

void main() {
    int N, M;
    readf("%d %d\n", N, M);

    auto L = readln.chomp.split.to!(int[]);

    auto cnts = new int[](M+1);
    foreach (l; L) {
        if (l <= M) ++cnts[l];
    }

    foreach (i, c; cnts) {
        if (i > 0) writeln(i, " ", c);
    }
}
0