結果
問題 |
No.1285 ゴミ捨て
|
ユーザー |
![]() |
提出日時 | 2025-04-15 23:34:19 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 120 ms / 2,000 ms |
コード長 | 206 bytes |
コンパイル時間 | 276 ms |
コンパイル使用メモリ | 82,172 KB |
実行使用メモリ | 77,856 KB |
最終ジャッジ日時 | 2025-04-15 23:35:23 |
合計ジャッジ時間 | 2,943 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 22 |
ソースコード
import heapq n = int(input()) a = [int(input()) for _ in range(n)] a.sort() heap = [] for x in a: if heap and x > heap[0] + 1: heapq.heappop(heap) heapq.heappush(heap, x) print(len(heap))