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 <bits/stdc++.h>
#include "dungeons.h"
using namespace std;
typedef long long ll;
int n;
vector<int> s, p, w, l;
void init(int n1, vector<int> s1, vector<int> p1, vector<int> w1, vector<int> l1) {
n = n1; s = s1; p = p1; w = w1; l = l1;
}
ll simulate(int x1, int z1) {
ll i = x1, z = z1;
while (i < n) {
if (z >= s[i]) {
z += s[i];
i = w[i];
}
else {
z += p[i];
i = l[i];
}
}
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... |