結果

問題 No.1285 ゴミ捨て
ユーザー ygd.ygd.
提出日時 2020-11-13 21:26:47
言語 PyPy3
(7.3.13)
結果
RE  
(最新)
AC  
(最初)
実行時間 -
コード長 325 bytes
コンパイル時間 291 ms
コンパイル使用メモリ 87,272 KB
実行使用メモリ 81,960 KB
最終ジャッジ日時 2023-08-19 07:11:38
合計ジャッジ時間 10,043 ms
ジャッジサーバーID
(参考情報)
judge10 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
71,432 KB
testcase_01 AC 81 ms
71,264 KB
testcase_02 AC 85 ms
71,048 KB
testcase_03 AC 83 ms
71,160 KB
testcase_04 AC 81 ms
71,296 KB
testcase_05 AC 78 ms
70,864 KB
testcase_06 AC 80 ms
71,264 KB
testcase_07 AC 162 ms
81,184 KB
testcase_08 AC 104 ms
76,764 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 116 ms
77,712 KB
testcase_17 AC 117 ms
77,844 KB
testcase_18 AC 119 ms
77,616 KB
testcase_19 RE -
testcase_20 AC 122 ms
77,556 KB
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

from heapq import heapify, heappop, heappush
N = int(input())
A = []
for i in range(N):
    temp = int(input())
    A.append(temp)
A.sort()
X = []
heappush(X,A[0])

for i in range(1,N):
    nxt = A[i]
    if nxt <= X[0] + 1:
        heappush(X,nxt)
    else:
        heappop(X)
        heappush(X,nxt)
ans = len(X)
print(ans)
0