Submission #1081769

#TimeUsernameProblemLanguageResultExecution timeMemory
1081769raphael_heuchlDungeons Game (IOI21_dungeons)C++17
11 / 100
7068 ms26664 KiB
#include "dungeons.h" #include <vector> struct Room { int s, p, w, l; }; int N; std::vector<Room> dungs; void init(int n, std::vector<int> s, std::vector<int> p, std::vector<int> w, std::vector<int> l) { N = n; dungs.resize(n); for (int i = 0; i < n; ++i) dungs[i] = {s[i], p[i], w[i], l[i]}; } long long simulate(int x, int z) { if (x == N) return z; if (z >= dungs[x].s) return simulate(dungs[x].w, z + dungs[x].s); return simulate(dungs[x].l, z + dungs[x].p); }
#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...