#include "dungeons.h"
#include <vector>
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int N=4e5+5;
int sz,S[N],P[N],W[N],L[N];
void init(int n, std::vector<int> s, std::vector<int> p, std::vector<int> w, std::vector<int> l) {
sz=n;
for(int i=1;i<=n;i++){
S[i]=s[i-1];
P[i]=p[i-1];
W[i]=w[i-1];
L[i]=l[i-1];
W[i]++;
L[i]++;
}
return;
}
long long simulate(int x, int z) {
++x;
long long power=z;
while(x!=sz+1){
if(power>=S[x]){
power+=S[x];
x=W[x];
}
else{
power+=P[x];
x=L[x];
}
}
return power;
}
# | 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... |