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<bits/stdc++.h>
using namespace std;
#define vi vector<int>
int n1;
vector<int> s1,p1,w1,l1;
void init(int n,vi s,vi p,vi w, vi l){
n1=n;
for(int i=0;i<n;i++){
s1.push_back(s[i]);
}
for(int i=0;i<n;i++){
p1.push_back(p[i]);
}
for(int i=0;i<n;i++){
w1.push_back(w[i]);
}
for(int i=0;i<n;i++){
l1.push_back(l[i]);
}
}
long long simulate(int x,int z){
long long pom=z;
while(x!=n1){
if(s1[x]<=pom){
pom+=s1[x];
x=w1[x];
}
else{
pom+=p1[x];
x=l1[x];
}
}
return pom;
}
# | 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... |