# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
442930 | alan8585 | Dungeons Game (IOI21_dungeons) | C++17 | 7074 ms | 21652 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 <iostream>
#include <vector>
#include <bits/stdc++.h>
using namespace std;
vector<int> to[2], S[2];
int N;
void init(int n, std::vector<int> s, std::vector<int> p, std::vector<int> w, std::vector<int> l) {
N = n;
for(int i = 0; i < n; i++) {
S[1].push_back(s[i]);
S[0].push_back(p[i]);
}
for(int i = 0; i < n; i++) {
to[1].push_back(w[i]);
to[0].push_back(l[i]);
}
return;
}
long long simulate(int x, int z) {
long long Z = z;
int cnt = 0;
while(x != N) {
bool flag = (S[1][x] <= Z);
Z += S[flag][x];
x = to[flag][x];
}
return Z;
}
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... |