結果

問題 No.711 競技レーティング単調増加
ユーザー sjikisjiki
提出日時 2021-09-23 22:50:22
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 550 bytes
コンパイル時間 142 ms
コンパイル使用メモリ 10,728 KB
実行使用メモリ 31,380 KB
最終ジャッジ日時 2023-09-18 20:02:59
合計ジャッジ時間 5,182 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,908 KB
testcase_01 AC 17 ms
7,884 KB
testcase_02 AC 16 ms
7,900 KB
testcase_03 WA -
testcase_04 AC 16 ms
7,900 KB
testcase_05 WA -
testcase_06 AC 16 ms
7,896 KB
testcase_07 WA -
testcase_08 AC 15 ms
7,940 KB
testcase_09 AC 16 ms
7,804 KB
testcase_10 AC 16 ms
7,932 KB
testcase_11 AC 15 ms
7,868 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 AC 69 ms
11,272 KB
testcase_37 AC 91 ms
29,124 KB
testcase_38 AC 84 ms
28,676 KB
testcase_39 AC 55 ms
19,516 KB
testcase_40 AC 80 ms
21,812 KB
testcase_41 AC 16 ms
7,880 KB
testcase_42 AC 51 ms
19,452 KB
testcase_43 AC 65 ms
23,800 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from bisect import bisect_left
n = int(input())
A = list(map(int,input().split()))
def lis(A: list):
    L = [A[0]]
    for a in A[1:]:
        if a > L[-1]:
            # Lの末尾よりaが大きければ増加部分列を延長できる
            L.append(a)
        else:
            # そうでなければ、「aより小さい最大要素の次」をaにする
            # 該当位置は、二分探索で特定できる
            L[bisect_left(L, a)] = a
    return len(L)


# -----------------------------------------
print(n-lis(A))
0