結果

問題 No.1285 ゴミ捨て
ユーザー roarisroaris
提出日時 2020-11-13 21:30:37
言語 PyPy3
(7.3.15)
結果
RE  
(最新)
AC  
(最初)
実行時間 -
コード長 319 bytes
コンパイル時間 651 ms
コンパイル使用メモリ 86,856 KB
実行使用メモリ 80,296 KB
最終ジャッジ日時 2023-08-19 07:13:46
合計ジャッジ時間 10,278 ms
ジャッジサーバーID
(参考情報)
judge12 / judge9
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 93 ms
71,708 KB
testcase_01 AC 90 ms
71,720 KB
testcase_02 AC 92 ms
71,536 KB
testcase_03 AC 91 ms
71,332 KB
testcase_04 AC 91 ms
71,400 KB
testcase_05 AC 90 ms
71,428 KB
testcase_06 AC 94 ms
71,644 KB
testcase_07 AC 143 ms
78,940 KB
testcase_08 AC 102 ms
77,624 KB
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 AC 107 ms
77,652 KB
testcase_17 AC 107 ms
77,640 KB
testcase_18 AC 106 ms
77,736 KB
testcase_19 RE -
testcase_20 AC 110 ms
77,856 KB
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
from collections import *
from heapq import *

N = int(input())
A = [int(input()) for _ in range(N)]
A.sort()
pq = []
ans = 0

for Ai in A:
    if len(pq)>0 and pq[0]+1<Ai:
        heappop(pq)
        heappush(pq, Ai)
    else:
        ans += 1
        heappush(pq, Ai)

print(ans)
0