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;
using ll = long long;
ll n;
vector<ll> s,p,w,l;
void init(int N, std::vector<int> S, std::vector<int> P, std::vector<int> W, std::vector<int> L) {
n = N;
s.assign(S.begin(),S.end());
p.assign(P.begin(),P.end());
w.assign(W.begin(),W.end());
l.assign(L.begin(),L.end());
return;
}
long long simulate(int x, int z) {
ll ans = z;
ll i = x;
while(i!=n){
if(ans<s[i]){
ans += p[i];
i = l[i];
}else{
ans += s[i];
i = w[i];
}
}
return ans;
}
# | 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... |