結果

問題 No.1032 数数え
ユーザー tanon710
提出日時 2020-04-23 21:22:26
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 369 ms / 2,000 ms
コード長 241 bytes
コンパイル時間 81 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 36,608 KB
最終ジャッジ日時 2024-10-13 23:17:58
合計ジャッジ時間 1,850 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections

n,m=map(int,input().split())
arr=list(map(int,input().split()))
cnt=collections.Counter(arr)
for i in range(1,m+1):
    if i not in cnt:
        print("{} {}".format(i,0))
    else:
        print("{} {}".format(i,cnt[i]))
0