Submission #1019236

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
10192362024-07-10 16:04:28aykhnDungeons Game (IOI21_dungeons)C++17
50 / 100
7034 ms399000 KiB
#include "dungeons.h"
#include <bits/stdc++.h>
using namespace std;
#define inf 0x3F3F3F3F
const int MXN = 4e5 + 5;
const int LOG = 24;
int N;
array<long long, 2> dpw[LOG][MXN], dplw[LOG][MXN];
long long dplp[LOG][MXN];
long long dep[MXN];
void init(int n, vector<int> s, vector<int> p, vector<int> w, vector<int> l)
{
N = n;
for (int i = n - 1; i >= 0; i--) dep[i] = dep[w[i]] + s[i];
for (int i = 0; i < n; i++)
{
dpw[0][i] = {w[i], s[i] + dep[i]};
dplp[0][i] = l[i];
dplw[0][i] = {p[i], s[i]};
}
dpw[0][n] = {n, -inf}, dplp[0][n] = n, dplw[0][n] = {0, -inf};
for (int lg = 1; lg < LOG; lg++)
{
for (int i = 0; i <= n; i++)
{
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
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...