# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
533931 | amunduzbaev | Peru (RMI20_peru) | C++17 | 762 ms | 21560 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "bits/stdc++.h"
using namespace std;
#include "peru.h"
#ifndef EVAL
#include "grader.cpp"
#endif
#define i32 int32_t
#define ar array
#define int long long
const int N = 25e5 + 5;
const int mod = 1e9 + 7;
int a[N], dp[N];
i32 solve(i32 n, i32 k, i32* a){
memset(dp, 127, sizeof dp);
for(int i=0;i<n;i++){
int mx = a[i];
for(int j=i-1;j>=max(0ll, i-k);j--){
dp[i] = min(dp[i], dp[j] + mx);
mx = max(mx, 1ll * a[j]);
}
if(i < k) dp[i] = min(dp[i], mx);
}
int res = 0;
for(int i=0;i<n;i++){
res = (res * 23ll + dp[i]) % mod;
//~ cout<<dp[i]<<" ";
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |