# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
834354 | Abrar_Al_Samit | Dungeons Game (IOI21_dungeons) | C++17 | 74 ms | 35932 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 nax = 4e5 + 3;
int n;
vector<int>s, p, w, l;
long long sum_toN[nax];
vector<int>g[nax];
void dfs(int v, long long sum = 0) {
if(v < n) sum += s[v];
sum_toN[v] = sum;
for(int u : g[v]) {
dfs(u, sum);
}
}
const int lg = 25;
long long sp[nax][lg], agg[nax][lg];
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 i=0; i<n; ++i) {
g[w[i]].push_back(i);
}
dfs(n);
for(int i=0; i<n; ++i) {
# | 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... |