結果
問題 |
No.711 競技レーティング単調増加
|
ユーザー |
👑 ![]() |
提出日時 | 2020-09-26 20:19:44 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 496 bytes |
コンパイル時間 | 1,545 ms |
コンパイル使用メモリ | 166,676 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-29 19:36:43 |
合計ジャッジ時間 | 6,405 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 13 WA * 16 RE * 12 |
ソースコード
#include<bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0; i<(n); i++) int N; int A[100000]; int LIS[100002]; int main() { cin >> N; rep(i, N) cin >> A[i]; rep(i, N) A[i] -= i; rep(i, N + 2) LIS[i] = 2000000000; LIS[0] = -2000000000; rep(i, N) { auto p = upper_bound(LIS, LIS + N + 2, A[i]); *p = A[i]; } int ans = 0; rep(i, N + 1) if (LIS[i] != 2000000000) ans = i; ans = N - ans; cout << ans << endl; return 0; }