結果

問題 No.711 競技レーティング単調増加
ユーザー しらっ亭しらっ亭
提出日時 2017-10-02 11:57:04
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 532 bytes
コンパイル時間 1,526 ms
コンパイル使用メモリ 169,852 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-27 18:14:58
合計ジャッジ時間 3,791 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 2 ms
6,944 KB
testcase_03 AC 2 ms
6,944 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 WA -
testcase_06 AC 2 ms
6,940 KB
testcase_07 AC 2 ms
6,944 KB
testcase_08 AC 2 ms
6,940 KB
testcase_09 AC 2 ms
6,944 KB
testcase_10 AC 2 ms
6,944 KB
testcase_11 AC 2 ms
6,944 KB
testcase_12 AC 2 ms
6,944 KB
testcase_13 AC 2 ms
6,940 KB
testcase_14 AC 2 ms
6,940 KB
testcase_15 AC 2 ms
6,940 KB
testcase_16 AC 2 ms
6,940 KB
testcase_17 AC 2 ms
6,940 KB
testcase_18 AC 24 ms
6,944 KB
testcase_19 AC 23 ms
6,940 KB
testcase_20 AC 25 ms
6,944 KB
testcase_21 AC 26 ms
6,940 KB
testcase_22 AC 24 ms
6,940 KB
testcase_23 AC 27 ms
6,944 KB
testcase_24 AC 27 ms
6,940 KB
testcase_25 AC 23 ms
6,940 KB
testcase_26 WA -
testcase_27 AC 23 ms
6,940 KB
testcase_28 AC 15 ms
6,940 KB
testcase_29 AC 18 ms
6,940 KB
testcase_30 AC 29 ms
6,944 KB
testcase_31 AC 34 ms
6,940 KB
testcase_32 AC 35 ms
6,940 KB
testcase_33 AC 32 ms
6,940 KB
testcase_34 AC 31 ms
6,940 KB
testcase_35 AC 34 ms
6,940 KB
testcase_36 AC 13 ms
6,944 KB
testcase_37 AC 30 ms
6,944 KB
testcase_38 AC 23 ms
6,940 KB
testcase_39 AC 12 ms
6,940 KB
testcase_40 AC 17 ms
6,944 KB
testcase_41 AC 2 ms
6,944 KB
testcase_42 AC 17 ms
6,944 KB
testcase_43 AC 23 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int solve() {
	int n;
	cin >> n;
	vector<int> A;
	for (int i = 0; i < n; i++) {
		int a;
		cin >> a;
		if (a - i >= 0) {
			A.emplace_back(a - i);
		}
	}

	int m = A.size();
	const int inf = 1e9;
	vector<int> dp(m, inf);
	for (int i = 0; i < m; i++) *upper_bound(dp.begin(), dp.end(), A[i]) = A[i];
	int lis = lower_bound(dp.begin(), dp.end(), inf) - dp.begin();

	return n - lis;
}

int main() {
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << solve() << endl;
	return 0;
}
0