結果

問題 No.711 競技レーティング単調増加
ユーザー ransewhaleransewhale
提出日時 2018-07-13 21:49:37
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 84 ms / 2,000 ms
コード長 725 bytes
コンパイル時間 1,749 ms
コンパイル使用メモリ 165,072 KB
実行使用メモリ 6,888 KB
最終ジャッジ日時 2023-07-30 09:37:10
合計ジャッジ時間 5,169 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
5,164 KB
testcase_01 AC 3 ms
5,240 KB
testcase_02 AC 3 ms
5,084 KB
testcase_03 AC 3 ms
5,172 KB
testcase_04 AC 3 ms
5,068 KB
testcase_05 AC 3 ms
5,080 KB
testcase_06 AC 3 ms
5,180 KB
testcase_07 AC 3 ms
5,072 KB
testcase_08 AC 3 ms
5,200 KB
testcase_09 AC 3 ms
5,172 KB
testcase_10 AC 3 ms
5,236 KB
testcase_11 AC 3 ms
5,236 KB
testcase_12 AC 3 ms
5,288 KB
testcase_13 AC 3 ms
5,164 KB
testcase_14 AC 3 ms
5,420 KB
testcase_15 AC 3 ms
5,232 KB
testcase_16 AC 3 ms
5,140 KB
testcase_17 AC 3 ms
5,060 KB
testcase_18 AC 55 ms
6,436 KB
testcase_19 AC 53 ms
6,436 KB
testcase_20 AC 56 ms
6,544 KB
testcase_21 AC 59 ms
6,544 KB
testcase_22 AC 53 ms
6,440 KB
testcase_23 AC 61 ms
6,708 KB
testcase_24 AC 61 ms
6,600 KB
testcase_25 AC 51 ms
6,548 KB
testcase_26 AC 56 ms
6,520 KB
testcase_27 AC 50 ms
6,436 KB
testcase_28 AC 42 ms
6,608 KB
testcase_29 AC 50 ms
6,644 KB
testcase_30 AC 64 ms
6,504 KB
testcase_31 AC 77 ms
6,628 KB
testcase_32 AC 81 ms
6,560 KB
testcase_33 AC 77 ms
6,564 KB
testcase_34 AC 71 ms
6,464 KB
testcase_35 AC 80 ms
6,632 KB
testcase_36 AC 32 ms
6,692 KB
testcase_37 AC 84 ms
6,888 KB
testcase_38 AC 60 ms
6,460 KB
testcase_39 AC 30 ms
5,864 KB
testcase_40 AC 41 ms
6,008 KB
testcase_41 AC 3 ms
5,200 KB
testcase_42 AC 37 ms
6,084 KB
testcase_43 AC 49 ms
6,484 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define INF (1<<30)
#define INFLL (1ll<<60)
typedef pair<double, int> P;
typedef pair<int, P> E;
#define MOD (1000000007ll)
#define l_ength size
#define EPS (1e-10)

void add_mod(ll &a, ll b){
	a += b;
	a %= MOD;
}

void mul_mod(ll &a, ll b){
	a *= b;
	a %= MOD;
}

int main(void){
	int n,i;
	ll a[225816],b[225816];
	fill(b,b+225816,INFLL);
	cin >> n;
	for(i=0; i<n; ++i){
		cin >> a[i];
		a[i] -= i;
	}
	for(i=0; i<n; ++i){
		if(a[i]<1){
			continue;
		}
		if(*lower_bound(b,b+n,a[i]) == a[i]){
			*lower_bound(b,b+n,a[i]+1) = a[i];
		}else{
			*lower_bound(b,b+n,a[i]) = a[i];
		}
	}
	cout << ((n-(int)(lower_bound(b,b+n,INFLL)-b))) << endl;
	return 0;
}
0