Submission #442808

#TimeUsernameProblemLanguageResultExecution timeMemory
442808baluteshihDungeons Game (IOI21_dungeons)C++17
11 / 100
7084 ms19752 KiB
#include "dungeons.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define X first
#define Y second
#define ALL(v) v.begin(), v.end()
#define pb push_back
#define SZ(a) ((int)a.size())

int N;
vector<int> S, P, W, L;

void init(int n, vector<int> s, vector<int> p, vector<int> w, vector<int> l) {
    N = n;
    S = s;
    P = p;
    W = w;
    L = l;
	return;
}

long long simulate(int x, int z) {
    ll nw = z;
    while (x != N) {
        if (nw >= S[x])
            nw += S[x], x = W[x];
        else
            nw += P[x], x = L[x];
    }
	return nw;
}
#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...