結果

問題 No.711 競技レーティング単調増加
ユーザー rapurasurapurasu
提出日時 2018-07-13 09:22:15
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 741 bytes
コンパイル時間 1,597 ms
コンパイル使用メモリ 163,480 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-16 06:47:43
合計ジャッジ時間 5,919 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
5,248 KB
testcase_01 AC 4 ms
5,376 KB
testcase_02 AC 3 ms
5,376 KB
testcase_03 WA -
testcase_04 AC 3 ms
5,376 KB
testcase_05 WA -
testcase_06 AC 3 ms
5,376 KB
testcase_07 AC 4 ms
5,376 KB
testcase_08 AC 4 ms
5,376 KB
testcase_09 AC 4 ms
5,376 KB
testcase_10 AC 4 ms
5,376 KB
testcase_11 AC 4 ms
5,376 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 2 ms
5,376 KB
testcase_16 AC 3 ms
5,376 KB
testcase_17 AC 3 ms
5,376 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 72 ms
6,528 KB
testcase_31 AC 86 ms
6,528 KB
testcase_32 AC 90 ms
6,528 KB
testcase_33 AC 81 ms
6,656 KB
testcase_34 AC 78 ms
6,656 KB
testcase_35 AC 85 ms
6,784 KB
testcase_36 AC 45 ms
6,656 KB
testcase_37 AC 98 ms
6,656 KB
testcase_38 AC 71 ms
6,528 KB
testcase_39 AC 38 ms
6,016 KB
testcase_40 AC 47 ms
6,144 KB
testcase_41 AC 4 ms
5,376 KB
testcase_42 AC 38 ms
5,888 KB
testcase_43 AC 54 ms
6,400 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
typedef long long LL;
LL A[200001];
LL B[200011];
int N;

int binary_serach(LL x){
	int lb=-1;
	int ub=200010;
	while(ub-lb>1){
		int mid=(ub+lb)/2;
		if(B[mid]>x){
			ub=mid;
		}else{
			lb=mid;
		}
	}
	return ub;
}

int main(){
	cin>>N;
	REP(i,N){
		cin>>A[i];
		A[i]-=i;
	}
	REP(i,200011){
		B[i]=1e12;
	}
	REP(i,N){
		int b=binary_serach(A[i]);
		B[b]=A[i];
		/*cout<<"test"<<endl;
		REP(j,10){
			cout<<B[j]<<endl;
		}*/
	}
	int ans=0;
	REP(i,200011){
		if(B[i]!=1e12)ans++;
	}
	cout<<N-ans<<endl;
	return(0);
}
0