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;
int nn;
vector<int> ss, pp, ww, ll;
void init(int n, vector<int> s, vector<int> p, vector<int> w, vector<int> l) {
nn = n; ss.resize(n); pp.resize(n); ww.resize(n); ll.resize(n);
for(int i = 0; i < n; i++) ss[i] = s[i], pp[i] = p[i], ww[i] = w[i], ll[i] = l[i];
}
long long simulate(int x, int z) {
long long k = z;
while(x < nn) {
if(k < ss[x]) k += pp[x], x = ll[x];
else k += ss[x], x = ww[x];
}
return k;
}
# | 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... |