結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 WA -
testcase_04 AC 2 ms
4,380 KB
testcase_05 WA -
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 2 ms
4,376 KB
testcase_16 AC 1 ms
4,376 KB
testcase_17 AC 2 ms
4,380 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 63 ms
4,600 KB
testcase_31 AC 76 ms
4,732 KB
testcase_32 AC 80 ms
4,744 KB
testcase_33 AC 72 ms
4,960 KB
testcase_34 AC 67 ms
4,712 KB
testcase_35 AC 76 ms
4,936 KB
testcase_36 AC 37 ms
4,960 KB
testcase_37 AC 83 ms
4,796 KB
testcase_38 AC 59 ms
4,724 KB
testcase_39 AC 30 ms
4,376 KB
testcase_40 AC 40 ms
4,380 KB
testcase_41 AC 1 ms
4,376 KB
testcase_42 AC 34 ms
4,380 KB
testcase_43 AC 48 ms
4,388 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int N;
int A[200000];
int LIS[200002];

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