Submission #1224113

#TimeUsernameProblemLanguageResultExecution timeMemory
1224113GabrielDungeons Game (IOI21_dungeons)C++20
11 / 100
7094 ms26008 KiB
#include "dungeons.h" #include <bits/stdc++.h> using namespace std; vector< pair<long long, long long> > Grafo, Ganar_Perder; long long Ganaste; void init(int n, vector<int> s, vector<int> p, vector<int> w, vector<int> l){ Grafo.assign(n + 1, {}); Ganar_Perder.assign(n, {}); Ganaste = n; for(long long i = 0; i < n; i++){ Grafo[i] = {w[i], l[i]}; Ganar_Perder[i] = {s[i], p[i]}; } } long long simulate(int x, int z){ if(x == Ganaste) return z; if(z < Ganar_Perder[x].first) return simulate(Grafo[x].second, z + Ganar_Perder[x].second); else return simulate(Grafo[x].first, z + Ganar_Perder[x].first); }
#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...