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>
#include<bits/stdc++.h>
using namespace std;
#define vi vector<int>
using ll=long long;
#define vl vector<long long>
vl s;
vl p;
vl w;
vl l;
ll n;
void init(int N, std::vector<int> S, std::vector<int> P, std::vector<int> W, std::vector<int> L) {
n=N;
s.resize(n);
w.resize(n);
p.resize(n);
l.resize(n);
for(int i=0;i<n;i++){
s[i]=S[i];
p[i]=P[i];
w[i]=W[i];
l[i]=L[i];
}
return;
}
long long simulate(int X, int Z) {
ll x=X;ll z=Z;
while(x!=n){
if(z>=s[x]){
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... |