| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1355950 | kawhiet | Cyberland (APIO23_cyberland) | C++20 | 2496 ms | 22008 KiB |
#include <bits/stdc++.h>
#include "cyberland.h"
using namespace std;
constexpr double inf = 1e18;
double solve(int n, int m, int k, int h, vector<int> x, vector<int> y, vector<int> c, vector<int> arr) {
vector<double> dp(k + 1, inf), ndp(k + 1, inf);
dp[0] = 0;
for (int i = 0; i < h; i++) {
fill(ndp.begin(), ndp.end(), inf);
for (int j = 0; j <= k; j++) {
if (dp[j] == inf) continue;
double cur = dp[j] + c[i];
if (arr[i + 1] == 0) {
ndp[j] = 0;
} else if (arr[i + 1] == 1) {
ndp[j] = min(ndp[j], cur);
} else {
ndp[j] = min(ndp[j], cur);
if (j + 1 <= k) {
ndp[j + 1] = min(ndp[j + 1], cur / 2.0);
}
}
}
swap(dp, ndp);
}
return ranges::min(dp);
}| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
