結果

問題 No.1285 ゴミ捨て
ユーザー lllllll88938494
提出日時 2022-01-13 07:19:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 122 ms / 2,000 ms
コード長 386 bytes
コンパイル時間 169 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 78,336 KB
最終ジャッジ日時 2024-11-16 08:56:40
合計ジャッジ時間 3,235 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

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(n):
        if lis[i] == 1:
            continue
        if now > ns[i]+1:
            now = ns[i]
            lis[i] = 1


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

                    
print(cnt)
    
0