結果

問題 No.711 競技レーティング単調増加
ユーザー maspymaspy
提出日時 2020-03-25 22:31:54
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 577 bytes
コンパイル時間 193 ms
コンパイル使用メモリ 10,812 KB
実行使用メモリ 26,768 KB
最終ジャッジ日時 2023-08-30 11:49:28
合計ジャッジ時間 8,092 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
8,248 KB
testcase_01 AC 16 ms
7,832 KB
testcase_02 AC 16 ms
8,180 KB
testcase_03 WA -
testcase_04 AC 17 ms
8,228 KB
testcase_05 WA -
testcase_06 AC 17 ms
8,292 KB
testcase_07 AC 17 ms
8,160 KB
testcase_08 AC 16 ms
8,100 KB
testcase_09 AC 17 ms
8,288 KB
testcase_10 AC 17 ms
8,160 KB
testcase_11 AC 17 ms
8,128 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 16 ms
8,112 KB
testcase_16 AC 17 ms
8,312 KB
testcase_17 AC 17 ms
8,192 KB
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 AC 150 ms
23,304 KB
testcase_31 AC 161 ms
23,980 KB
testcase_32 AC 168 ms
24,976 KB
testcase_33 AC 168 ms
25,968 KB
testcase_34 AC 157 ms
24,608 KB
testcase_35 AC 175 ms
26,768 KB
testcase_36 AC 147 ms
18,788 KB
testcase_37 AC 159 ms
25,704 KB
testcase_38 AC 149 ms
24,536 KB
testcase_39 AC 89 ms
17,580 KB
testcase_40 AC 109 ms
20,176 KB
testcase_41 AC 17 ms
8,112 KB
testcase_42 AC 91 ms
17,428 KB
testcase_43 AC 128 ms
21,652 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/ python3.8
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N, *A = map(int, read().split())


def longest_increasing_subsequence(seq, wider_sense=True):
    from bisect import bisect_left, bisect_right
    f = bisect_right if wider_sense else bisect_left
    N = len(seq)
    INF = 10**18
    dp = [INF] * (N + 1)
    for x in seq:
        i = f(dp, x)
        dp[i] = x
    return f(dp, INF - 1)


B = [x - i for i, x in enumerate(A)]
answer = N - longest_increasing_subsequence(B)
print(answer)
0