Submission #1057459

#TimeUsernameProblemLanguageResultExecution timeMemory
1057459TrentDungeons Game (IOI21_dungeons)C++17
11 / 100
7095 ms19764 KiB
#include "dungeons.h" #include "bits/stdc++.h" using namespace std; #define forR(i, x) for(int i = 0; i < (x); ++i) #define REP(i, a, b) for(int i = (a); i < (b); ++i) typedef long long ll; typedef vector<int> vi; int n; vi 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; } long long simulate(int x, int z) { int ci = x; ll cv = z; while(ci != n) { if(cv < s[ci]) { cv += p[ci]; ci = l[ci]; } else { cv += s[ci]; ci = w[ci]; } } return cv; }
#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...