結果

問題 No.1285 ゴミ捨て
ユーザー lllllll88938494
提出日時 2022-01-13 07:11:51
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 339 bytes
コンパイル時間 174 ms
コンパイル使用メモリ 82,352 KB
実行使用メモリ 78,368 KB
最終ジャッジ日時 2024-11-16 06:24:45
合計ジャッジ時間 3,933 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 10 WA * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
ns=[int(input()) for i in range(n)]
ns.sort(reverse=True)
lis=[0]*n
cnt=0

def  cal(x):
    lis[x]=1
    now = ns[x]
    for i in range(1,n):
        if now > ns[i]+1:
            now = ns[i]+1
            lis[i] = 1


for i in range(n):
    if lis[i] == 0:
        cal(i)
        cnt+=1
                    
print(cnt)
    
0