Submission #440097

#TimeUsernameProblemLanguageResultExecution timeMemory
440097algorithm16Dungeons Game (IOI21_dungeons)C++17
11 / 100
7092 ms24224 KiB
#include "dungeons.h" #include<iostream> #include<vector> #include<algorithm> using namespace std; typedef long long int llint; vector <int> s1,p1,w1,l1; llint n1; void init(int n,std::vector<int> s,std::vector<int> p,std::vector<int> w,std::vector<int> l) { n1=n; s1=s; p1=p; w1=w; l1=l; return; } long long simulate(int x, int z) { llint ret=z; while(x!=n1) { if(ret<s1[x]) { ret+=p1[x]; x=l1[x]; } else { ret+=s1[x]; x=w1[x]; } } return ret; }
#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...