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;
long long N;
vector<int> wp;
vector<int> lp;
vector<int> W;
vector<int> L;
void init(int n, std::vector<int> s, std::vector<int> p, std::vector<int> w, std::vector<int> l) {
N = n;
wp = s;
lp = p;
W = w;
L = l;
return;
}
long long res;
void solve(long long num1, long long num2){
if(num1 == N){
res = num2;
return;
}
if(num2 >= wp[num1]){
num2+=wp[num1];
solve(W[num1], num2);
}else{
num2+=lp[num1];
solve(L[num1], num2);
}
}
long long simulate(int x, int z) {
solve(x,z);
return res;
}
# | 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... |