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<iostream>
#include<vector>
#include<algorithm>
using namespace std;
typedef long long int llint;
vector <int> s1,p1,w1,l1;
llint n1;
void init(int n,std::vector<int> s,std::vector<int> p,std::vector<int> w,std::vector<int> l) {
n1=n;
s1=s;
p1=p;
w1=w;
l1=l;
return;
}
long long simulate(int x, int z) {
llint ret=z;
while(x!=n1) {
if(ret<s1[x]) {
ret+=p1[x];
x=l1[x];
}
else {
ret+=s1[x];
x=w1[x];
}
}
return ret;
}
# | 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... |