# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
443535 | JvThunder | Dungeons Game (IOI21_dungeons) | C++17 | 0 ms | 0 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>
#define fr first
#define sc second
typedef long long ll;
using namespace std;
int bs = 5;
const int nop = 5;
const int noa = 19;
int INF = 1e9+7;
ll add[400005] = {0};
pair<int,pair<int,ll>> jump[nop][noa][400005];
int N;
vector<int> S,P,W,L;
void init(int n, vector<int> s, vector<int> p, vector<int> w, vector<int> l)
{
S = s; P = p; W = w; L = l; N = n;
S.push_back(INF);
P.push_back(INF);
W.push_back(n);
L.push_back(n);
for(int i=n-1; i>=0; i--) add[i] = add[W[i]] + S[i];
for(int ph=0; ph<nop; ph++)
{