Submission #1053146

#TimeUsernameProblemLanguageResultExecution timeMemory
1053146MarwenElarbiDungeons Game (IOI21_dungeons)C++17
11 / 100
7087 ms19784 KiB
#include <bits/stdc++.h> using namespace std; #include "dungeons.h" vector <int> ss,pp,ww,ll; int N; void init(int n, std::vector<int> s, std::vector<int> p, std::vector<int> w, std::vector<int> l) { ss=s; pp=p; ww=w; ll=l; N=n; return; } long long simulate(int x, int z) { long long ans=z; while(x!=N){ if(ans>=ss[x]){ ans+=ss[x]; x=ww[x]; }else{ ans+=pp[x]; x=ll[x]; } } return ans; }
#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...