結果

問題 No.1032 数数え
ユーザー zyxwzyxw
提出日時 2021-02-05 11:00:01
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 394 bytes
コンパイル時間 281 ms
コンパイル使用メモリ 87,232 KB
実行使用メモリ 109,096 KB
最終ジャッジ日時 2023-09-14 17:24:52
合計ジャッジ時間 2,626 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,296 KB
testcase_01 AC 73 ms
71,236 KB
testcase_02 AC 72 ms
71,484 KB
testcase_03 AC 76 ms
71,152 KB
testcase_04 AC 73 ms
71,312 KB
testcase_05 AC 73 ms
71,444 KB
testcase_06 AC 75 ms
71,364 KB
testcase_07 WA -
testcase_08 AC 75 ms
71,184 KB
testcase_09 WA -
testcase_10 AC 75 ms
71,452 KB
testcase_11 AC 74 ms
71,396 KB
testcase_12 AC 224 ms
108,972 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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==len(L)-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)
0