結果

問題 No.711 競技レーティング単調増加
ユーザー milanis48663220milanis48663220
提出日時 2020-06-12 01:50:44
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 34 ms / 2,000 ms
コード長 749 bytes
コンパイル時間 620 ms
コンパイル使用メモリ 82,788 KB
実行使用メモリ 5,080 KB
最終ジャッジ日時 2023-09-06 08:51:24
合計ジャッジ時間 2,912 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 2 ms
4,376 KB
testcase_15 AC 1 ms
4,376 KB
testcase_16 AC 2 ms
4,380 KB
testcase_17 AC 2 ms
4,380 KB
testcase_18 AC 26 ms
4,756 KB
testcase_19 AC 25 ms
4,800 KB
testcase_20 AC 26 ms
4,924 KB
testcase_21 AC 27 ms
5,080 KB
testcase_22 AC 25 ms
4,780 KB
testcase_23 AC 28 ms
4,868 KB
testcase_24 AC 28 ms
4,864 KB
testcase_25 AC 24 ms
4,852 KB
testcase_26 AC 26 ms
4,708 KB
testcase_27 AC 24 ms
4,696 KB
testcase_28 AC 15 ms
4,644 KB
testcase_29 AC 17 ms
4,928 KB
testcase_30 AC 27 ms
4,660 KB
testcase_31 AC 32 ms
4,848 KB
testcase_32 AC 34 ms
4,740 KB
testcase_33 AC 32 ms
4,824 KB
testcase_34 AC 29 ms
4,720 KB
testcase_35 AC 33 ms
4,940 KB
testcase_36 AC 13 ms
4,904 KB
testcase_37 AC 31 ms
4,928 KB
testcase_38 AC 24 ms
4,716 KB
testcase_39 AC 11 ms
4,376 KB
testcase_40 AC 17 ms
4,376 KB
testcase_41 AC 2 ms
4,376 KB
testcase_42 AC 16 ms
4,448 KB
testcase_43 AC 22 ms
4,392 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <queue>
#include <set>
#include <map>

using namespace std;
typedef long long ll;

int N;
int A[200000];

int dp[200005];
const int INF = 2e9;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << setprecision(10) << fixed;
    cin >> N;
    for(int i = 0; i <= N; i++){
        dp[i] = INF;
    }
    for(int i = 0; i < N; i++) {
        cin >> A[i];
        A[i] -= i;
    }
    for(int i = 0; i < N; i++){
        if(A[i] <= 0) continue;
        auto p = upper_bound(dp, dp+N+1, A[i]);
        *p = min(A[i], *p);
    }
    int ans = 0;
    for(int i = 0; i < N; i++){
        if(dp[i] != INF) ans = i+1;
    }
    cout << N-ans << endl;
}
0