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;
const int MAXN=4e5+6;
int g1[MAXN];
int g2[MAXN],n1;
int strength[MAXN];
int points[MAXN];
void init(int n, vector<int> s, vector<int> p, vector<int> w, vector<int> l) {
n1=n;
for(int i=0;i<n;i++)
{
points[i]=p[i];
strength[i]=s[i];
g1[i]=l[i];
g2[i]=w[i];
}
}
long long simulate(int x, int z) {
for(;;)
{
if(x==n1)return z;
if(z>=strength[x])
{
z+=strength[x];
x=g2[x];
}
else
{
z+=points[x];
x=g1[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... |