結果

問題 No.711 競技レーティング単調増加
ユーザー milanis48663220milanis48663220
提出日時 2020-06-12 01:44:01
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 717 bytes
コンパイル時間 705 ms
コンパイル使用メモリ 82,580 KB
実行使用メモリ 5,192 KB
最終ジャッジ日時 2023-09-06 08:51:03
合計ジャッジ時間 3,939 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 WA -
testcase_04 AC 1 ms
4,380 KB
testcase_05 WA -
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 2 ms
4,376 KB
testcase_10 AC 2 ms
4,380 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,380 KB
testcase_17 AC 2 ms
4,376 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 26 ms
4,836 KB
testcase_31 AC 31 ms
4,708 KB
testcase_32 AC 32 ms
4,852 KB
testcase_33 AC 30 ms
4,848 KB
testcase_34 AC 28 ms
4,844 KB
testcase_35 AC 31 ms
4,936 KB
testcase_36 AC 16 ms
5,120 KB
testcase_37 AC 27 ms
4,836 KB
testcase_38 AC 21 ms
4,764 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 14 ms
4,376 KB
testcase_43 AC 21 ms
4,660 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++){
        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