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 <bits/stdc++.h>
#define ll long long
using namespace std;
namespace
{
int n;
vector<int> s, p, w, l;
}
void init(int n, vector<int> s, vector<int> p, vector<int> w, vector<int> l)
{
::n = n;
::s = s, ::p = p, ::w = w, ::l = l;
return;
}
ll simulate(int x, int _z)
{
ll z = _z;
while(x != n)
{
if(z >= s[x])
{
z += s[x];
x = w[x];
}
else
{
z += p[x];
x = l[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... |