結果

問題 No.1285 ゴミ捨て
ユーザー lam6er
提出日時 2025-04-16 16:04:54
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 323 bytes
コンパイル時間 587 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 78,336 KB
最終ジャッジ日時 2025-04-16 16:11:50
合計ジャッジ時間 3,323 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 10 WA * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect

n = int(input())
a = sorted([int(input()) for _ in range(n)])
ans = 0
i = 0
while i < n:
    ans += 1
    current = a[i]
    while True:
        next_pos = bisect.bisect_right(a, current + 1)
        if next_pos >= n:
            break
        current = a[next_pos]
        i = next_pos
    i += 1
print(ans)
0