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 ll long long
using namespace std;
int n;
vector<int> s, p, w, l;
void init(int nn, vector<int> ss, vector<int> pp, vector<int> ww, vector<int> l1) {
n = nn;
s = ss;
p = pp;
w = ww;
l = l1;
}
long long simulate(int x, int z) {
ll st = z;
while(x != n)
{
if(st >= s[x])
st += s[x], x = w[x];
else
st += p[x], x = l[x];
}
return st;
}
# | 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... |