Submission #621018

#TimeUsernameProblemLanguageResultExecution timeMemory
621018HamletPetrosyanDungeons Game (IOI21_dungeons)C++17
11 / 100
7088 ms32940 KiB
#include "dungeons.h" #include <vector> using namespace std; #define ll long long #define add push_back #define len(a) ((int)(a).size()) #define all(a) a.begin(), a.end() const int N = 4e5 + 5; ll n; ll s[N], p[N], l[N], w[N]; void init(int N, vector<int> S, vector<int> P, vector<int> W, vector<int> L) { n = N; for(int i = 0; i < n; i++){ s[i] = S[i]; p[i] = P[i]; w[i] = W[i]; l[i] = L[i]; } } long long simulate(int x, int z) { while(x != n){ if(s[x] <= z){ 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...