# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1171671 | fryingduc | Discharging (NOI20_discharging) | C++20 | 335 ms | 188312 KiB |
#include "bits/stdc++.h"
using namespace std;
#ifdef duc_debug
#include "bits/debug.h"
#else
#define debug(...)
#endif
#define int long long
const int maxn = 1e6 + 6;
const int inf = 1e18;
const int lg = 21;
int up[maxn][lg + 1];
int n, a[maxn], f[maxn];
int best[maxn];
namespace mmb{
const int N = 3003;
int g[N];
void solve(){
for(int i = 1; i <= n; ++i){
int mx = a[i];
f[i] = g[i] = inf;
for(int j = i; j; --j){
mx = max(mx, a[j]);
int cur = f[j - 1] + mx * (n - j + 1);
f[i] = min(f[i], cur);
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |