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>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define X first
#define Y second
#define ALL(v) v.begin(), v.end()
#define pb push_back
#define SZ(a) ((int)a.size())
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;
}
long long simulate(int x, int z) {
ll nw = z;
while (x != N) {
if (nw >= S[x])
nw += S[x], x = W[x];
else
nw += P[x], x = L[x];
}
return nw;
}
# | 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... |