# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
201629 | waynetuinfor | Collecting Stamps 3 (JOI20_ho_t3) | C++17 | 144 ms | 66808 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <algorithm>
#include <array>
#include <iostream>
#include <vector>
int main() {
int n, l;
std::cin >> n >> l;
std::vector<int> x(n + 2, 0), t(n + 2, 0);
for (int i = 1; i <= n; ++i) std::cin >> x[i];
for (int i = 1; i <= n; ++i) std::cin >> t[i];
x[n + 1] = l;
std::vector<std::vector<std::vector<std::array<int, 2>>>> dp(
n + 2, std::vector<std::vector<std::array<int, 2>>>(
n + 2, std::vector<std::array<int, 2>>(n + 2)));
constexpr int kInf = 1'000'000'000;
for (int i = 0; i <= n + 1; ++i) {
for (int j = 0; j <= n + 1; ++j) {
for (int k = 0; k <= n + 1; ++k) {
dp[i][j][k][0] = kInf;
dp[i][j][k][1] = kInf;
}
}
}
dp[0][n + 1][0][0] = 0;
dp[0][n + 1][0][1] = 0;
for (int i = 0; i <= n + 1; ++i) {
for (int j = n + 1; j >= 0; --j) {
for (int k = 0; k <= n + 1; ++k) {
if (dp[i][j][k][0] != kInf) {
# | 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... |