Submission #1059560

#TimeUsernameProblemLanguageResultExecution timeMemory
1059560LittleOrangeDungeons Game (IOI21_dungeons)C++17
11 / 100
7085 ms33056 KiB
#include "dungeons.h" #include <vector> #include<bits/stdc++.h> using namespace std; using ll = long long; ll n; vector<ll> s,p,w,l; void init(int N, std::vector<int> S, std::vector<int> P, std::vector<int> W, std::vector<int> L) { n = N; s.assign(S.begin(),S.end()); p.assign(P.begin(),P.end()); w.assign(W.begin(),W.end()); l.assign(L.begin(),L.end()); return; } long long simulate(int x, int z) { ll ans = z; ll i = x; while(i!=n){ if(ans<s[i]){ ans += p[i]; i = l[i]; }else{ ans += s[i]; i = w[i]; } } 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...