Submission #466491

#TimeUsernameProblemLanguageResultExecution timeMemory
466491alexxela12345Dungeons Game (IOI21_dungeons)C++17
11 / 100
7042 ms26652 KiB
#include "dungeons.h"
#include <vector>

using namespace std;

typedef long long ll;

int n;
vector<int> s, p, w, l;

void init(int n_, std::vector<int> s_, std::vector<int> p_, std::vector<int> w_, std::vector<int> l_) {
    n = n_;
    s = s_;
    p = p_;
    w = w_;
    l = l_;
}

long long simulate(int x, int z_) {
    ll z = z_;
    while (x != n) {
        if (z >= s[x]) {
            z += s[x];
            x = w[x];
        } else {
            z += p[x];
            x = l[x];
        }
    }
	return z;
}

#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...