# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
924876 | Programmer123 | Dungeons Game (IOI21_dungeons) | C++17 | 7154 ms | 1695008 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 "dungeons.h"
#include <bits/stdc++.h>
#define JUMP_SIZE 40
std::vector<int> s, p, w, l;
int N;
long long *minBlitz, *gainBlitz;
int **jumpTo;
__int128_t **jumpGain;
bool identical = true;
long long dp(int node, long long str);
long long calc(int node, long long str) {
if (str >= s[node]) {
return dp(w[node], str + s[node]);
} else return dp(l[node], str + p[node]);
}
std::unordered_map<long long, long long> *cache;
long long dp(int node, long long str) {
assert(node != N);
if (str >= minBlitz[node]) return str + gainBlitz[node];
if (!cache[node].count(str)) {
cache[node][str] = calc(node, str);
}
return cache[node][str];
}
# | 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... |