# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
893855 | agawron | Rabbit Carrot (LMIO19_triusis) | C++14 | 33 ms | 5620 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
constexpr int MAX_N = 2e5 + 5;
constexpr int INF = 1e9;
int n, m;
int a[MAX_N];
int b[MAX_N];
vector <int> v;
int LIS(){
int sz = v.size();
vector <int> d(sz + 1, INF);
d[0] = -INF;
for(int i = 0; i < sz; i++){
int l = upper_bound(d.begin(), d.end(), v[i]) - d.begin();
if(d[l - 1] <= v[i] && v[i] < d[l]){
d[l] = v[i];
}
}
int ans = 0;
for(int i = 0; i <= sz; i++){
if(d[i] < INF){
ans = i;
}
}
return ans;
}
int main(){
scanf("%d %d", &n, &m);
for(int i = 1; i <= n; i++){
scanf("%d", &a[i]);
}
int cnt = 0;
for(int i = 1; i <= n; i++){
b[i] = m * i - a[i];
if(b[i] >= 0) v.pb(b[i]);
}
cnt = n - LIS();
printf("%d\n", cnt);
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... |