# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
837874 | IS_Rushdi | Dungeons Game (IOI21_dungeons) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "dungeons.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n;
vector<int>s,p,w,l;
void init(int N, vector<int> S,vector<int> P,vector<int> W,vector<int> L) {
s=S;
p=P;
w=W;
l=L;
}
ll simulate(int i, int curr) {
while(i != n){
if(curr >= s[i]){
curr+=s[i];
idx=w[i];
}
else{
curr+=p[i];
idx=l[i];
}
}
return curr;
}