답안 #521746

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
521746 2022-02-03T00:49:41 Z penguin133 Rabbit Carrot (LMIO19_triusis) C++14
0 / 100
1 ms 304 KB
#include <bits/stdc++.h>
using namespace std;

int dp[200005], A[200005];

int main(){
	int n,m, maxi =0 ;cin >> n >> m;
	for(int i=1;i<=n;i++)cin >> A[i];
	for(int i=1;i<=n;i++){
		if(A[i] > m * i)dp[i] = -1e9;
		else {
			for(int j=0;j<i;j++)if(A[i] - m <= A[j])dp[i] = max(dp[i], dp[j] + 1);
		}
		maxi = max(maxi, dp[i]);
	}
	cout << n-maxi;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 300 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 0 ms 296 KB Output is correct
11 Correct 0 ms 204 KB Output is correct
12 Incorrect 1 ms 304 KB Output isn't correct
13 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 300 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 0 ms 296 KB Output is correct
11 Correct 0 ms 204 KB Output is correct
12 Incorrect 1 ms 304 KB Output isn't correct
13 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 300 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 0 ms 296 KB Output is correct
11 Correct 0 ms 204 KB Output is correct
12 Incorrect 1 ms 304 KB Output isn't correct
13 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 300 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 0 ms 296 KB Output is correct
11 Correct 0 ms 204 KB Output is correct
12 Incorrect 1 ms 304 KB Output isn't correct
13 Halted 0 ms 0 KB -