結果
| 問題 |
No.711 競技レーティング単調増加
|
| コンテスト | |
| ユーザー |
maspy
|
| 提出日時 | 2020-03-25 22:36:05 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 616 bytes |
| コンパイル時間 | 259 ms |
| コンパイル使用メモリ | 12,288 KB |
| 実行使用メモリ | 29,040 KB |
| 最終ジャッジ日時 | 2025-01-02 00:11:58 |
| 合計ジャッジ時間 | 6,110 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 39 WA * 2 |
ソースコード
#!/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:
if x < 0:
continue
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)
maspy