#include "dungeons.h"
#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 50000, MAX_P = 10000;
vector<int> s,p,w,l;
int n;
void init(int nn, vector<int> ss, vector<int> pp, vector<int> ww, vector<int> ll) {
s = ss; p = pp; w = ww; l = ll; n = nn;
return;
}
long long simulate(int x, int z) {
int pos = x;
while( pos != n) {
if (z >= s[pos]) {
z += s[pos];
pos = w[pos];
}
else {
z += p[pos];
pos = l[pos];
}
}
return z;
}
# | 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... |