Submission #1064294

#TimeUsernameProblemLanguageResultExecution timeMemory
1064294fv3Dungeons Game (IOI21_dungeons)C++17
11 / 100
7093 ms26672 KiB
#include "dungeons.h" #include <bits/stdc++.h> 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; } ll strength; void sim(int index) { if (index == N) return; if (strength >= S[index]) { strength += S[index]; sim(W[index]); } else { strength += P[index]; sim(L[index]); } } ll simulate(int x, int z) { strength = z; sim(x); return strength; }
#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...