結果
問題 |
No.1285 ゴミ捨て
|
ユーザー |
![]() |
提出日時 | 2025-04-16 16:05:18 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 148 ms / 2,000 ms |
コード長 | 303 bytes |
コンパイル時間 | 761 ms |
コンパイル使用メモリ | 81,792 KB |
実行使用メモリ | 77,440 KB |
最終ジャッジ日時 | 2025-04-16 16:12:26 |
合計ジャッジ時間 | 3,801 ms |
ジャッジサーバーID (参考情報) |
judge3 / 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))