結果
問題 |
No.1285 ゴミ捨て
|
ユーザー |
|
提出日時 | 2022-10-28 21:46:49 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 338 bytes |
コンパイル時間 | 241 ms |
コンパイル使用メモリ | 82,456 KB |
実行使用メモリ | 79,984 KB |
最終ジャッジ日時 | 2024-07-06 00:53:09 |
合計ジャッジ時間 | 5,094 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 12 WA * 10 |
ソースコード
import bisect as bs n = int(input()) a = sorted([int(input()) for _ in range(n)]) used = [False for _ in range(n)] ans = 0 for i in range(n): if used[i]: continue used[i] = True ans += 1 cur = i while cur < n: j = bs.bisect_left(a, a[cur] + 2) if j < n and not used[j]: used[j] = True cur = j print(ans)