Submission #1176153

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
11761532025-03-30 04:06:24gygDungeons Game (IOI21_dungeons)C++20
37 / 100
7105 ms605500 KiB
#include "dungeons.h"
#include <bits/stdc++.h>
using namespace std;
#define sig signed
#define int long long
#define vec vector
#define arr array
const int N = 4e5 + 5, LG = 27;
int n;
arr<int, N> wn, ls, wn_nd, ls_nd;
arr<arr<vec<int>, N>, LG> jmp;
void jmp_cmp() {
for (int u = 0; u <= n; u++)
jmp[0][u] = {wn_nd[u], wn[u], wn[u]};
for (int i = 1; i <= 25; i++) {
for (int u = 0; u <= n; u++) {
vec<int> x = jmp[i - 1][u];
vec<int> y = jmp[i - 1][x[0]];
jmp[i][u] = {y[0], x[1] + y[1], max(x[2], y[2] - x[1])};
}
}
}
void init(sig _n, vec<sig> _wn, vec<sig> _ls, vec<sig> _wn_nd, vec<sig> _ls_nd) {
n = _n;
for (int u = 0; u < n; u++)
wn[u] = _wn[u], ls[u] = _ls[u], wn_nd[u] = _wn_nd[u], ls_nd[u] = _ls_nd[u];
wn[n] = ls[n] = 0, wn_nd[n] = ls_nd[n] = n;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...