結果

問題 No.1285 ゴミ捨て
ユーザー proribone
提出日時 2020-11-13 21:54:36
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 149 ms / 2,000 ms
コード長 228 bytes
コンパイル時間 176 ms
コンパイル使用メモリ 81,888 KB
実行使用メモリ 77,440 KB
最終ジャッジ日時 2024-11-28 21:45:48
合計ジャッジ時間 3,500 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

from bisect import bisect_left
N=int(input())
A=[int(input()) for _ in range(N)]
A.sort()

ar=[-1]
for i in range(N):
    b=bisect_left(ar,A[i]-1)
    if b>0:
        ar[b-1]=A[i]
    else:
        ar.append(A[i])
print(len(ar))
0