Submission #792041

# Submission time Handle Problem Language Result Execution time Memory
792041 2023-07-24T14:14:11 Z 12345678 Rabbit Carrot (LMIO19_triusis) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>

using namespace std;

const int nx=5e4+5;
int n, m, a[nx], dp[nx][nx], ans=1e9;

int main()
{
    cin.tie(NULL)->sync_with_stdio(false);
    cin>>n>>m;
    for (int i=1; i<=n; i++) cin>>a[i];
    for (int i=1; i<nx; i++) dp[0][i]=nx;
    for (int i=1; i<=n; i++)
    {
        for (int j=0; j<nx; j++) dp[i][j]=dp[i-1][j]+1;
        for (int j=max(0, a[i]-m); j<nx; j++) dp[i][a[i]]=min(dp[i][a[i]], dp[i-1][j]);
    }
    for (int i=0; i<nx; i++) ans=min(ans, dp[n][i]);
    cout<<ans;
}

Compilation message

/usr/bin/ld: failed to convert GOTPCREL relocation; relink with --no-relax
collect2: error: ld returned 1 exit status