Submission #441961

#TimeUsernameProblemLanguageResultExecution timeMemory
441961victoriadDungeons Game (IOI21_dungeons)C++17
0 / 100
7042 ms460 KiB
#include <cmath> #include <iostream> #include <utility> #include <algorithm> #include <cstdio> #include <vector> #include <string> #include <fstream> #include "dungeons.h" using namespace std; vector<int>nextwin,nextlos,stre,los; int N; void init(int n, std::vector<int> s, std::vector<int> p, std::vector<int> w, std::vector<int> l) { nextwin.resize(n); N=n; for(int i=0;i<n;i++){ nextwin[i]=w[i]; } nextlos.resize(n); for(int i=0;i<n;i++){ nextlos[i]=l[i]; } stre.resize(n); for(int i=0;i<n;i++){ stre[i]=s[i]; } los.resize(n); for(int i=0;i<n;i++){ los[i]=l[i]; } return; } long long simulate(int x, int z) { long long int pow=z; int act=z; while(act!=N){ if(pow>=stre[act]){ pow+=stre[act]; act=nextwin[act]; } else{ pow+=los[act]; act=nextlos[act]; } } return pow; }
#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...