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;
#include "dungeons.h"
const int sub1MX = 10000;
int N;
vector<int> S, P, W, L;
int move(int x, int z){
if(x == N) return z;
if(z >= S[x]) return move(W[x], z + S[x]);
else return move(L[x], z + P[x]);
}
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;
}
long long simulate(int x, int z){
return (long long) move(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... |