Submission #837301

#TimeUsernameProblemLanguageResultExecution timeMemory
837301ma_moutahidDungeons Game (IOI21_dungeons)C++17
11 / 100
7071 ms32932 KiB
#include "dungeons.h" #include <vector> #include<bits/stdc++.h> using namespace std; #define vi vector<int> using ll=long long; #define vl vector<long long> vl s; vl p; vl w; vl l; ll n; void init(int N, std::vector<int> S, std::vector<int> P, std::vector<int> W, std::vector<int> L) { n=N; s.resize(n); w.resize(n); p.resize(n); l.resize(n); for(int i=0;i<n;i++){ s[i]=S[i]; p[i]=P[i]; w[i]=W[i]; l[i]=L[i]; } return; } long long simulate(int X, int Z) { ll x=X;ll z=Z; while(x!=n){ if(z>=s[x]){ z+=s[x]; x=w[x]; } else { z+=p[x]; x=l[x]; } } return 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...