結果

問題 No.1285 ゴミ捨て
ユーザー brthyyjpbrthyyjp
提出日時 2020-11-14 16:04:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 135 ms / 2,000 ms
コード長 269 bytes
コンパイル時間 273 ms
コンパイル使用メモリ 82,424 KB
実行使用メモリ 77,952 KB
最終ジャッジ日時 2024-05-06 14:36:31
合計ジャッジ時間 3,064 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
52,224 KB
testcase_01 AC 39 ms
52,436 KB
testcase_02 AC 38 ms
52,352 KB
testcase_03 AC 38 ms
52,096 KB
testcase_04 AC 38 ms
51,968 KB
testcase_05 AC 38 ms
51,968 KB
testcase_06 AC 39 ms
52,096 KB
testcase_07 AC 131 ms
77,568 KB
testcase_08 AC 66 ms
70,144 KB
testcase_09 AC 100 ms
76,928 KB
testcase_10 AC 122 ms
77,568 KB
testcase_11 AC 120 ms
77,824 KB
testcase_12 AC 108 ms
76,928 KB
testcase_13 AC 108 ms
77,160 KB
testcase_14 AC 132 ms
77,856 KB
testcase_15 AC 114 ms
77,236 KB
testcase_16 AC 78 ms
76,544 KB
testcase_17 AC 80 ms
76,416 KB
testcase_18 AC 77 ms
76,288 KB
testcase_19 AC 96 ms
76,672 KB
testcase_20 AC 79 ms
76,160 KB
testcase_21 AC 91 ms
76,264 KB
testcase_22 AC 134 ms
77,828 KB
testcase_23 AC 135 ms
77,952 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