답안 #487659

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
487659 2021-11-16T10:46:02 Z stefantaga Stove (JOI18_stove) C++14
50 / 100
36 ms 47620 KB
#include <bits/stdc++.h>

using namespace std;
long long din[5005][5005];
long long mini,v[5005];
int n,k,i,j;
int main()
{
    #ifdef HOME
    ifstream cin("date.in");
    ofstream cout("date.out");
    #endif // HOME
    cin>>n>>k;
    for (i=1;i<=n;i++)
    {
        cin>>v[i];
        din[1][i]=v[i]-v[1]+1;
    }
    for (i=2;i<=k;i++)
    {
        mini=1e18;
        for (j=i;j<=n;j++)
        {
            mini=min(mini,din[i-1][j-1]-v[j]);
            din[i][j]=v[j]+mini+1;
        }
    }
    cout<<din[k][n]<<'\n';
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 208 KB Output is correct
2 Correct 0 ms 208 KB Output is correct
3 Correct 0 ms 208 KB Output is correct
4 Correct 0 ms 336 KB Output is correct
5 Correct 0 ms 336 KB Output is correct
6 Correct 1 ms 208 KB Output is correct
7 Correct 0 ms 336 KB Output is correct
8 Correct 0 ms 336 KB Output is correct
9 Correct 0 ms 308 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 208 KB Output is correct
2 Correct 0 ms 208 KB Output is correct
3 Correct 0 ms 208 KB Output is correct
4 Correct 0 ms 336 KB Output is correct
5 Correct 0 ms 336 KB Output is correct
6 Correct 1 ms 208 KB Output is correct
7 Correct 0 ms 336 KB Output is correct
8 Correct 0 ms 336 KB Output is correct
9 Correct 0 ms 308 KB Output is correct
10 Correct 2 ms 724 KB Output is correct
11 Correct 3 ms 3024 KB Output is correct
12 Correct 12 ms 23888 KB Output is correct
13 Correct 20 ms 39672 KB Output is correct
14 Correct 22 ms 47136 KB Output is correct
15 Correct 23 ms 47620 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 208 KB Output is correct
2 Correct 0 ms 208 KB Output is correct
3 Correct 0 ms 208 KB Output is correct
4 Correct 0 ms 336 KB Output is correct
5 Correct 0 ms 336 KB Output is correct
6 Correct 1 ms 208 KB Output is correct
7 Correct 0 ms 336 KB Output is correct
8 Correct 0 ms 336 KB Output is correct
9 Correct 0 ms 308 KB Output is correct
10 Correct 2 ms 724 KB Output is correct
11 Correct 3 ms 3024 KB Output is correct
12 Correct 12 ms 23888 KB Output is correct
13 Correct 20 ms 39672 KB Output is correct
14 Correct 22 ms 47136 KB Output is correct
15 Correct 23 ms 47620 KB Output is correct
16 Incorrect 36 ms 2376 KB Output isn't correct
17 Halted 0 ms 0 KB -