結果

問題 No.1285 ゴミ捨て
ユーザー brthyyjpbrthyyjp
提出日時 2020-11-14 16:04:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 164 ms / 2,000 ms
コード長 269 bytes
コンパイル時間 285 ms
コンパイル使用メモリ 87,276 KB
実行使用メモリ 79,036 KB
最終ジャッジ日時 2023-08-19 07:21:53
合計ジャッジ時間 4,330 ms
ジャッジサーバーID
(参考情報)
judge15 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,368 KB
testcase_01 AC 72 ms
71,196 KB
testcase_02 AC 79 ms
71,456 KB
testcase_03 AC 72 ms
71,464 KB
testcase_04 AC 72 ms
71,536 KB
testcase_05 AC 74 ms
71,176 KB
testcase_06 AC 75 ms
71,496 KB
testcase_07 AC 156 ms
78,620 KB
testcase_08 AC 99 ms
77,136 KB
testcase_09 AC 128 ms
77,868 KB
testcase_10 AC 153 ms
78,900 KB
testcase_11 AC 150 ms
78,812 KB
testcase_12 AC 138 ms
78,476 KB
testcase_13 AC 138 ms
78,252 KB
testcase_14 AC 156 ms
78,924 KB
testcase_15 AC 143 ms
78,144 KB
testcase_16 AC 110 ms
77,512 KB
testcase_17 AC 110 ms
77,504 KB
testcase_18 AC 110 ms
77,492 KB
testcase_19 AC 127 ms
78,184 KB
testcase_20 AC 110 ms
77,672 KB
testcase_21 AC 117 ms
77,912 KB
testcase_22 AC 163 ms
78,968 KB
testcase_23 AC 164 ms
79,036 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
A = [int(input()) for i in range(n)]

if n == 1:
    print(1)
    exit()

A.sort()
B = [A[0]]
import bisect
for i in range(1, n):
    j = bisect.bisect_left(B, A[i]-1)
    if j == 0:
        B.append(A[i])
    else:
        B[j-1] = A[i]
print(len(B))
0