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;
vector<int> s, p, w, l;
int n;
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;
return;
}
long long simulate(int x, int z) {
long long cur = z;
while (x != n) {
if (cur >= s[x]) {
cur += s[x];
x = w[x];
}
else {
cur += p[x];
x = l[x];
}
}
return cur;
}
# | 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... |