Submission #438087

#TimeUsernameProblemLanguageResultExecution timeMemory
438087CyanForcesDungeons Game (IOI21_dungeons)C++17
11 / 100
7099 ms20164 KiB
#include "dungeons.h" #include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for(int i = a; i < (b); ++i) #define all(x) begin(x), end(x) #define sz(x) (int)(x).size() #define debug(...) //ignore typedef long long ll; typedef pair<int, int> pii; typedef vector<int> vi; typedef long double ld; 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; return; } ll sim(int x, ll z) { if(x == n) return z; if(z >= s[x]) return sim(w[x], z+s[x]); else return sim(l[x], z+p[x]); } ll simulate(int x, int z) { return sim(x,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...