結果

問題 No.711 競技レーティング単調増加
ユーザー 👑 NachiaNachia
提出日時 2020-09-26 20:19:44
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 496 bytes
コンパイル時間 1,447 ms
コンパイル使用メモリ 165,308 KB
実行使用メモリ 4,408 KB
最終ジャッジ日時 2023-09-12 06:34:14
合計ジャッジ時間 7,008 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 WA -
testcase_04 AC 2 ms
4,376 KB
testcase_05 WA -
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 2 ms
4,376 KB
testcase_16 AC 2 ms
4,380 KB
testcase_17 AC 1 ms
4,376 KB
testcase_18 RE -
testcase_19 RE -
testcase_20 WA -
testcase_21 RE -
testcase_22 WA -
testcase_23 RE -
testcase_24 WA -
testcase_25 RE -
testcase_26 WA -
testcase_27 RE -
testcase_28 WA -
testcase_29 WA -
testcase_30 RE -
testcase_31 RE -
testcase_32 RE -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 RE -
testcase_38 RE -
testcase_39 AC 31 ms
4,380 KB
testcase_40 WA -
testcase_41 AC 1 ms
4,380 KB
testcase_42 AC 34 ms
4,380 KB
testcase_43 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)

int N;
int A[100000];
int LIS[100002];

int main() {
    cin >> N;
    rep(i, N) cin >> A[i];
    rep(i, N) A[i] -= i;
    rep(i, N + 2) LIS[i] = 2000000000;
    LIS[0] = -2000000000;
    rep(i, N) {
        auto p = upper_bound(LIS, LIS + N + 2, A[i]);
        *p = A[i];
    }
    int ans = 0;
    rep(i, N + 1) if (LIS[i] != 2000000000) ans = i;
    ans = N - ans;
    cout << ans << endl;
    return 0;
}
0