# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
394749 | Qw3rTy | Rabbit Carrot (LMIO19_triusis) | C++11 | 1081 ms | 1628 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
using namespace std;
const int maxN = 2e5+5;
int f[maxN];
int a[maxN];
int N,M;
void testIO(){
freopen("../test.in","r",stdin);
return;
}
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;
for(int i = 1; i <= N; ++i){
if(a[i] > M*i)continue;
for(int j = 0; j < i; ++j){
if(a[j] + M*(i-j) >= a[i])f[i] = max(f[i],f[j]+1);
}
}
int res = 0;
for(int i = 1; i <= N; ++i)res = max(res,f[i]);
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... |