結果
| 問題 |
No.1285 ゴミ捨て
|
| コンテスト | |
| ユーザー |
lam6er
|
| 提出日時 | 2025-04-15 23:30:10 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 155 ms / 2,000 ms |
| コード長 | 303 bytes |
| コンパイル時間 | 337 ms |
| コンパイル使用メモリ | 82,232 KB |
| 実行使用メモリ | 77,828 KB |
| 最終ジャッジ日時 | 2025-04-15 23:31:36 |
| 合計ジャッジ時間 | 3,566 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 22 |
ソースコード
import bisect
n = int(input())
A = [int(input()) for _ in range(n)]
A.sort()
sorted_list = []
for x in A:
# Find the rightmost value <= x-2
idx = bisect.bisect_right(sorted_list, x - 2)
if idx > 0:
del sorted_list[idx - 1]
bisect.insort(sorted_list, x)
print(len(sorted_list))
lam6er