結果
| 問題 | No.711 競技レーティング単調増加 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-11-18 18:51:06 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 21 ms / 2,000 ms |
| + 316µs | |
| コード長 | 493 bytes |
| 記録 | |
| コンパイル時間 | 321 ms |
| コンパイル使用メモリ | 76,248 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-07-16 19:40:33 |
| 合計ジャッジ時間 | 2,905 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 41 |
ソースコード
#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
const int N = 200010, INF = 0x3f3f3f3f;
int n, f[N], ma;
int main() {
scanf("%d", &n);
memset(f, 0x3f, sizeof(f));
ma = 0;
for (int i = 1, x, idx; i <= n; ++i) {
scanf("%d", &x);
if (x >= i) {
idx = upper_bound(f + 1, f + n + 1, x - i) - f;
f[idx] = x - i;
ma = max(ma, idx);
}
}
printf("%d\n", n - ma);
return 0;
}