結果

問題 No.711 競技レーティング単調増加
ユーザー lam6er
提出日時 2025-04-15 23:00:55
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 284 bytes
コンパイル時間 139 ms
コンパイル使用メモリ 82,220 KB
実行使用メモリ 108,436 KB
最終ジャッジ日時 2025-04-15 23:01:41
合計ジャッジ時間 5,011 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24 WA * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect

n = int(input())
a = list(map(int, input().split()))
b = [a[i] - (i + 1) for i in range(n)]

tails = []
for num in b:
    idx = bisect.bisect_right(tails, num)
    if idx == len(tails):
        tails.append(num)
    else:
        tails[idx] = num

print(n - len(tails))
0