結果
問題 |
No.711 競技レーティング単調増加
|
ユーザー |
|
提出日時 | 2018-07-13 21:43:14 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 694 bytes |
コンパイル時間 | 1,724 ms |
コンパイル使用メモリ | 166,356 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-09 05:08:17 |
合計ジャッジ時間 | 4,895 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 WA * 17 |
ソースコード
#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(*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; }