# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
437969 | gs14004 | Dungeons Game (IOI21_dungeons) | C++17 | 5370 ms | 971604 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;
using lint = long long;
using pi = pair<int, int>;
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(), (v).end()
const int MAXN = 400005;
int n;
vector<int> s, p, w, l;
int nxt[8][25][MAXN];
int cost[8][25][MAXN];
int value[8][25][MAXN];
lint dp[MAXN];
void init(int _n, std::vector<int> _s, std::vector<int> _p, std::vector<int> _w, std::vector<int> _l) {
tie(n, s, p, w, l) = make_tuple(_n, _s, _p, _w, _l);
s.resize(n + 1);
for(int i = n - 1; i >= 0; i--) dp[i] = dp[w[i]] + s[i];
for(int i = 0; i < 8; i++){
int L = (1 << (3*i));
for(int j = 0; j < n; j++){
if(s[j] < L){
nxt[i][0][j] = w[j];
cost[i][0][j] = s[j];
value[i][0][j] = 1e9;
}
else{
nxt[i][0][j] = l[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... |