# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
828615 | Liudas | Dungeons Game (IOI21_dungeons) | C++17 | 7040 ms | 26692 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 <vector>
#include <cassert>
#include <cstdio>
using namespace std;
struct node{
int ws, ls, w, l;
};
vector<node> tree;
void init(int n, vector<int> s, vector<int> p, vector<int> w, vector<int> l){
tree.resize(n);
for(int i = 0; i < n; i ++){
tree[i].ws = s[i];
tree[i].ls = p[i];
tree[i].w = w[i];
tree[i].l = l[i];
}
}
long long simulate(int x, int z){
long long ans = z;
while(x != tree.size()){
if(ans >= tree[x].ws){
ans += tree[x].ws;
x = tree[x].w;
}
else{
ans += tree[x].ls;
x = tree[x].l;
}
}
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... |