# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
536461 | Icebear16 | Dungeons Game (IOI21_dungeons) | C++17 | 7068 ms | 20296 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 "dungeons.h"
#include <bits/stdc++.h>
int ans;
void dfs(int n, int z, std::vector<int> s, std::vector<int> p, std::vector<int> w, std::vector<int> l){
ans=z;
while(n!=s.size()){
if(ans>=s[n]){
ans+=s[n];
n=w[n];
}else{
ans+=p[n];
n=l[n];
}
}
}
std::vector<int> a;
std::vector<int> b;
std::vector<int> c;
std::vector<int> d;
void init(int n, std::vector<int> s, std::vector<int> p, std::vector<int> w, std::vector<int> l) {
a=s,b=p,c=w,d=l;
return;
}
long long simulate(int x, int z) {
dfs(x,z,a,b,c,d);
return ans;
}
Compilation message (stderr)
# | 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... |