結果
問題 |
No.711 競技レーティング単調増加
|
ユーザー |
![]() |
提出日時 | 2025-06-12 14:41:06 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 429 bytes |
コンパイル時間 | 2,764 ms |
コンパイル使用メモリ | 197,908 KB |
実行使用メモリ | 7,848 KB |
最終ジャッジ日時 | 2025-06-12 14:41:12 |
合計ジャッジ時間 | 5,715 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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; }