結果
| 問題 | No.711 競技レーティング単調増加 | 
| コンテスト | |
| ユーザー |  gew1fw | 
| 提出日時 | 2025-06-12 19:34:45 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 429 bytes | 
| コンパイル時間 | 5,283 ms | 
| コンパイル使用メモリ | 197,640 KB | 
| 実行使用メモリ | 7,848 KB | 
| 最終ジャッジ日時 | 2025-06-12 19:35:06 | 
| 合計ジャッジ時間 | 6,447 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 14 WA * 27 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
    int n;
    cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
    }
    vector<int> dp;
    for (int x : a) {
        auto it = lower_bound(dp.begin(), dp.end(), x);
        if (it == dp.end()) {
            dp.push_back(x);
        } else {
            *it = x;
        }
    }
    cout << n - dp.size() << endl;
    return 0;
}
            
            
            
        