# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
438653 | fleimgruber | Dungeons Game (IOI21_dungeons) | C++17 | 7076 ms | 738316 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>
using namespace std;
const int MAX_N = 400001;
const int MAX_LOG = 25; // 2^24 > 10^7
int n, s[MAX_N], p[MAX_N], w[MAX_N], l[MAX_N];
// MLE for other subtasks. probably requires smarter jump pointers
struct Subtask1345 {
// dp[i][j][k] = we're at i, simulate for 2^j steps and
// win against an opponent if strength < 2^k (we don't gain strength)
struct {
int end; // where do we end up at?
long long gained; // total strength gained on the path
// max(sum(gained) - opponent) along the simulation,
// for all opponents we lose against
long long max;
} dp[50001][MAX_LOG][MAX_LOG];
Subtask1345() {
for (int j = 0; j < MAX_LOG; j++)
for (int i = 0; i <= n; i++)
for (int k = 0; k < MAX_LOG; k++) {
auto& x = dp[i][j][k];
if (j == 0)
if (i == n) {
x.end = n;
# | 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... |