結果
| 問題 | 
                            No.1285 ゴミ捨て
                             | 
                    
| コンテスト | |
| ユーザー | 
                             osrgy01
                         | 
                    
| 提出日時 | 2021-05-15 14:40:22 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 260 bytes | 
| コンパイル時間 | 244 ms | 
| コンパイル使用メモリ | 12,544 KB | 
| 実行使用メモリ | 15,188 KB | 
| 最終ジャッジ日時 | 2024-10-03 03:06:21 | 
| 合計ジャッジ時間 | 5,475 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 10 WA * 12 | 
ソースコード
n=int(input())
t=sorted(int(input()) for _ in range(n))
i=0;ans=1
while i<len(t)-1:
    if t[i]+1<t[i+1]:
        i+=1
    else:
        j=i+1
        ans+=1
        while j<len(t)-1 and t[j]+1<t[j+1]:
            j+=1
            ans+=1
        i=j
print(ans)
            
            
            
        
            
osrgy01