結果

問題 No.711 競技レーティング単調増加
ユーザー kakira9618kakira9618
提出日時 2018-06-29 23:56:44
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,306 bytes
コンパイル時間 574 ms
コンパイル使用メモリ 86,240 KB
実行使用メモリ 4,952 KB
最終ジャッジ日時 2023-09-13 15:51:20
合計ジャッジ時間 3,801 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 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 WA -
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
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 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 AC 29 ms
4,376 KB
testcase_37 AC 76 ms
4,376 KB
testcase_38 AC 52 ms
4,376 KB
testcase_39 AC 27 ms
4,380 KB
testcase_40 AC 37 ms
4,380 KB
testcase_41 AC 2 ms
4,380 KB
testcase_42 AC 30 ms
4,504 KB
testcase_43 AC 43 ms
4,744 KB
権限があれば一括ダウンロードができます

ソースコード

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;
  for (int i = 0; i < N; i++) {
    int k = lower_bound(dp.begin(), dp.end(), A[i]) - dp.begin();
    if (dp.size() == k) {
      dp.push_back(A[i]);
    } else {
      dp[k] = A[i];
    }
  }
  return dp.size();
}

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

  return 0;
}
0