結果

問題 No.711 競技レーティング単調増加
ユーザー gew1fw
提出日時 2025-06-12 18:37:10
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 381 bytes
コンパイル時間 177 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 107,520 KB
最終ジャッジ日時 2025-06-12 18:37:18
合計ジャッジ時間 5,847 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 14 WA * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect

n = int(input())
a = list(map(int, input().split()))
tails = []

for x in a:
    idx = bisect.bisect_left(tails, x)
    if idx == 0:
        if not tails:
            tails.append(x)
        elif x < tails[0]:
            tails[0] = x
    else:
        if idx == len(tails):
            tails.append(x)
        else:
            tails[idx] = x

print(n - len(tails))
0