結果

問題 No.711 競技レーティング単調増加
ユーザー pluto77pluto77
提出日時 2018-08-15 09:53:01
言語 C++11
(gcc 13.3.0)
結果
AC  
実行時間 87 ms / 2,000 ms
コード長 299 bytes
コンパイル時間 1,348 ms
コンパイル使用メモリ 158,312 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-24 09:20:56
合計ジャッジ時間 5,114 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 41
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main(){
 int n,x,y,v[200010];
 cin>>n;
 for(int i=0;i<=n;i++)
  v[i]=1<<30;
 int ma=0;
 for(int i=1;i<=n;i++){
  cin>>x;
  x-=i;
  if(x<0)
   continue;
  y=lower_bound(v,v+n+1,x+1)-v;
  v[y]=x;
  ma=max(ma,y);
 }
 cout<<n-(ma+1)<<endl;
}
0