結果
| 問題 | No.711 競技レーティング単調増加 | 
| コンテスト | |
| ユーザー |  chocorusk | 
| 提出日時 | 2018-11-05 08:26:33 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 82 ms / 2,000 ms | 
| コード長 | 649 bytes | 
| コンパイル時間 | 1,136 ms | 
| コンパイル使用メモリ | 98,600 KB | 
| 実行使用メモリ | 6,820 KB | 
| 最終ジャッジ日時 | 2024-11-20 20:10:33 | 
| 合計ジャッジ時間 | 4,142 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 41 | 
ソースコード
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <random>
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
int main()
{
	vector<int> mn;
	int n;
	cin>>n;
	mn.push_back(0);
	int add=0;
	for(int i=0; i<n; i++){
		int a; cin>>a;
		int j=lower_bound(mn.begin(), mn.end(), a-add)-mn.begin();
		add++;
		if(j==mn.size()) mn.push_back(a-add);
		else if(j>0) mn[j]=a-add;
	}
	cout<<n+1-mn.size()<<endl;
	return 0;
}
            
            
            
        