Submission #438676

#TimeUsernameProblemLanguageResultExecution timeMemory
438676StickfishDungeons Game (IOI21_dungeons)C++17
11 / 100
7091 ms19752 KiB
#include "dungeons.h" #include <vector> using namespace std; const int MAXN = 4e5 + 123; int n; int edg[MAXN][2]; int p[MAXN][2]; void init(int n0, vector<int> sv, vector<int> pv, vector<int> wv, vector<int> lv) { n = n0; for(int i = 0; i < n; ++i){ edg[i][0] = wv[i]; edg[i][1] = lv[i]; p[i][0] = sv[i]; p[i][1] = pv[i]; } return; } long long simulate(int x, int z) { if(x >= n) return z; if(z >= p[x][0]){ return simulate(edg[x][0], z + p[x][0]); } else { return simulate(edg[x][1], z + p[x][1]); } }
#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...