| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 394951 | Qw3rTy | Rabbit Carrot (LMIO19_triusis) | C++11 | 1 ms | 332 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int maxN = 2e5+5;
int f[maxN];
int a[maxN];
int b[maxN];
int N,M;
void testIO(){
freopen("../test.in","r",stdin);
return;
}
int LIS(){
deque<int> dp;
for(int i = 1; i <= N; ++i){
if(b[i] > 0)continue;
int pos = lower_bound(dp.begin(),dp.end(),a[i]) - dp.begin();
if(pos == 0)dp.push_front(a[i]);
else dp[pos] = a[i];
}
return dp.size();
}
signed main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
//testIO();
cin >> N >> M;
for(int i = 1; i <= N; ++i)cin >> a[i];
a[0] = 0;
f[0] = 0;
//O(NlogN)
//find LIS on b[i], where b[i] = a[i] - M*i
for(int i = 1; i <= N; ++i)b[i] = a[i] - M*i;
int res = LIS();
cout << N - res << '\n';
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
