# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
439887 | phathnv | Dungeons Game (IOI21_dungeons) | C++17 | 6154 ms | 1302388 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 N = 4e5 + 7;
const int L4 = 7;
const int L2 = 24;
int n;
vector<int> s, p, w, l;
int nxt[L4][L2][N];
long long f[L4][L2][N], sum[L4][L2][N];
void init(int _n, vector<int> _s, vector<int> _p, vector<int> _w, vector<int> _l) {
n = _n;
s = _s;
p = _p;
w = _w;
l = _l;
for (int b = 0; b < L4; b++) {
for (int i = 0; i < n; i++) {
nxt[b][0][i] = (s[i] <= (1 << (4 * b))? w[i] : l[i]);
sum[b][0][i] = (s[i] <= (1 << (4 * b))? s[i] : p[i]);
f[b][0][i] = (s[i] < (1 << (4 * b))? 1e18 : s[i]);
}
nxt[b][0][n] = -1;
for (int i = 1; i < L2; i++)
for (int j = 0; j <= n; j++) {
nxt[b][i][j] = (nxt[b][i - 1][j] == -1? -1 : nxt[b][i - 1][nxt[b][i - 1][j]]);
# | 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... |