# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
542855 | AJ00 | Dungeons Game (IOI21_dungeons) | C++17 | 0 ms | 0 KiB |
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 int long long
int N;
vector<int> s,p,w,l
int simulate(int x, int z){
int moves = 0;
while(x != N){
moves++;
if (z >= s[x]){
z += s[x];
x = w[x];
}
else {
z += p[x];
x = l[x];
}
}
return moves;
}
void init(int n, vector<int> _s, vector<int> _p, vector<int> _w,vector<int> _l){
s = _s;
p = _p;
w = _w;
l = _l;
N = n;
}