結果
| 問題 | No.1285 ゴミ捨て |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-10-28 21:46:49 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 338 bytes |
| 記録 | |
| コンパイル時間 | 277 ms |
| コンパイル使用メモリ | 85,248 KB |
| 実行使用メモリ | 84,480 KB |
| 最終ジャッジ日時 | 2026-03-27 11:13:55 |
| 合計ジャッジ時間 | 4,076 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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)