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 <vector>
using namespace std;
const int MAXN = 4e5 + 123;
int n;
int edg[MAXN][2];
int p[MAXN][2];
void init(int n0, vector<int> sv, vector<int> pv, vector<int> wv, vector<int> lv) {
n = n0;
for(int i = 0; i < n; ++i){
edg[i][0] = wv[i];
edg[i][1] = lv[i];
p[i][0] = sv[i];
p[i][1] = pv[i];
}
return;
}
long long simulate(int x, int z) {
if(x >= n)
return z;
if(z >= p[x][0]){
return simulate(edg[x][0], z + p[x][0]);
} else {
return simulate(edg[x][1], z + p[x][1]);
}
}
# | 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... |