結果
| 問題 |
No.711 競技レーティング単調増加
|
| コンテスト | |
| ユーザー |
Nachia
|
| 提出日時 | 2020-09-26 20:20:59 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 550 bytes |
| コンパイル時間 | 1,558 ms |
| コンパイル使用メモリ | 166,800 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-06-29 19:36:48 |
| 合計ジャッジ時間 | 4,527 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 24 WA * 17 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
#define rep(i,n) for(int i=0; i<(n); i++)
int N;
int A[200000];
int LIS[200002];
int main() {
cin >> N;
rep(i, N) cin >> A[i];
rep(i, N) A[i] -= i;
rep(i, N + 2) LIS[i] = 2000000000;
LIS[0] = -2000000000;
rep(i, N) {
auto p = upper_bound(LIS, LIS + N + 2, A[i]);
*p = A[i];
}
int ans = 0;
rep(i, N + 1) if (LIS[i] != 2000000000) ans = i;
ans = N - ans;
cout << ans << endl;
return 0;
}
Nachia