Submission #1174306

#TimeUsernameProblemLanguageResultExecution timeMemory
1174306PagodePaivaDungeons Game (IOI21_dungeons)C++20
11 / 100
7094 ms19784 KiB
#include<bits/stdc++.h>
#include <vector>

using namespace std;

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

void init(int nn, std::vector<int> ss, std::vector<int> pp, std::vector<int> ww, std::vector<int> ll) {
    n = nn;
    s = ss;
    p = pp;
    w = ww;
    l = ll;
}

long long simulate(int st, int z) {
    int res = z;
    while(st != n){
        if(res >= s[st]){
            res += s[st];
            st = w[st];
        }
        else{
            res += p[st];
            st = l[st];
        }
    }
    return res;
}
#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...