結果
| 問題 | 
                            No.1032 数数え
                             | 
                    
| ユーザー | 
                             | 
                    
| 提出日時 | 2021-02-05 10:59:23 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 389 bytes | 
| コンパイル時間 | 164 ms | 
| コンパイル使用メモリ | 81,940 KB | 
| 実行使用メモリ | 108,032 KB | 
| 最終ジャッジ日時 | 2024-07-02 00:31:21 | 
| 合計ジャッジ時間 | 1,984 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 8 WA * 2 | 
ソースコード
N,M=map(int,input().split())
L=sorted(list(map(int,input().split())))
num=1
m=L[0]
ans=[0]*(m-1)
for i in range(1,len(L)):
    if L[i]==m:
        num+=1
        if i==N-1:
            ans.append(num)
    else:
        ans.append(num)
        ans+=[0]*(L[i]-m-1)
        num=1
        m=L[i]
for i in range(M):
    if len(ans)-1>=i:
        print(i+1,ans[i])
    else:
        print(i+1,0)