結果

問題 No.711 競技レーティング単調増加
ユーザー kakira9618kakira9618
提出日時 2018-06-30 00:26:00
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,333 bytes
コンパイル時間 594 ms
コンパイル使用メモリ 85,168 KB
実行使用メモリ 5,572 KB
最終ジャッジ日時 2023-09-13 15:56:31
合計ジャッジ時間 3,801 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 WA -
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 2 ms
4,376 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,376 KB
testcase_17 AC 1 ms
4,376 KB
testcase_18 AC 53 ms
4,444 KB
testcase_19 AC 51 ms
4,380 KB
testcase_20 AC 55 ms
4,472 KB
testcase_21 AC 57 ms
4,492 KB
testcase_22 AC 52 ms
4,528 KB
testcase_23 AC 59 ms
4,700 KB
testcase_24 AC 58 ms
4,524 KB
testcase_25 AC 48 ms
4,556 KB
testcase_26 AC 53 ms
4,452 KB
testcase_27 AC 49 ms
4,536 KB
testcase_28 AC 40 ms
4,376 KB
testcase_29 AC 47 ms
4,376 KB
testcase_30 AC 61 ms
5,072 KB
testcase_31 AC 75 ms
5,344 KB
testcase_32 AC 79 ms
5,364 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 AC 28 ms
4,376 KB
testcase_37 AC 81 ms
5,476 KB
testcase_38 AC 56 ms
5,400 KB
testcase_39 AC 28 ms
4,380 KB
testcase_40 AC 39 ms
4,380 KB
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <map>
#include <set>
#include <list>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <complex>
#include <cstdlib>
#include <cstring>
#include <numeric>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <functional>
  
#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
  
using namespace std;
  
typedef    long long          ll;
typedef    unsigned long long ull;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      pii;
  
const int INF=1<<30;
const double EPS=1e-9;
  
const int dx[]={1,0,-1,0,1,1,-1,-1},dy[]={0,-1,0,1,1,-1,-1,1};

int LIS(vector<int> &A) {
  int N = A.size();
  vector<int> dp(A.size() + 1, INF);
  for (int i = 0; i < N; i++) {
    *upper_bound(dp.begin(), dp.end(), A[i]) = A[i];
  }
  return lower_bound(dp.begin(), dp.end(), INF) - dp.begin();
}

int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  vector<int> B;
  for (int i = 0; i < N - 1; i++) {
    if (A[i] - i <= 0) continue;
    B.push_back(A[i] - i);
  }
  cout << N - LIS(B) << endl;

  return 0;
}
0