Submission #1061758

# Submission time Handle Problem Language Result Execution time Memory
1061758 2024-08-16T12:45:22 Z TimDee Peru (RMI20_peru) C++17
0 / 100
0 ms 344 KB
#include "peru.h"
#include <bits/stdc++.h>
using namespace std;
 
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("popcnt,avx2")

#define forn(i,n) for(int i=0; i<(n); ++i)
#define pb push_back
#define pi pair<int,int>
#define f first
#define s second 
using ll = long long;
const int N=2005;
ll dp[N];
const ll inf = 1e18;

int solve(int n, int k, int* v){
    const int mod = 1e9+7;

    ll ans=0;
    forn(i,n) {
        dp[i+1]=inf;
        int mx=v[i];
        for(int j=i; j>=max(i-k,0); --j) {
            dp[i+1]=min(dp[i+1],dp[j]+mx);
        }
        ans=(ans*23)%mod;
        ans=(ans+dp[i+1])%mod;
    }
    return ans;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -