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;
#define ll long long
#define add push_back
#define len(a) ((int)(a).size())
#define all(a) a.begin(), a.end()
const int N = 4e5 + 5;
ll n;
ll s[N], p[N], l[N], w[N];
void init(int N, vector<int> S, vector<int> P, vector<int> W, vector<int> L) {
n = N;
for(int i = 0; i < n; i++){
s[i] = S[i];
p[i] = P[i];
w[i] = W[i];
l[i] = L[i];
}
}
long long simulate(int x, int z) {
while(x != n){
if(s[x] <= z){
z += s[x];
x = w[x];
}
else{
z += p[x];
x = l[x];
}
}
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... |