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>
#include "dungeons.h"
using namespace std;
int ans=0,nn;
vector<int> se,le,pe,we;
void init(int n,vector<int> s,vector<int> p,vector<int> w,vector<int> l)
{
se.resize(n);
le.resize(n);
pe.resize(n);
we.resize(n);
nn=n;
se=s;
le=l;
we=w;
pe=p;
}
long long self(int x,int z)
{
if(x==nn)
return z;
if(z>=se[x])
return self(we[x],z+se[x]);
if(z<se[x])
return self(le[x],z+pe[x]);
return 0ll;
}
long long simulate(int x, int z)
{
return self(x,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... |