| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1312304 | opeleklanos | 던전 (IOI21_dungeons) | C++20 | 0 ms | 0 KiB |
#include <iostream>
#include <vector>
#include "dungeons"
using namespace std;
#define ll long long
vector<int> w, l, s, p;
int n;
void init(int n1, vector<int> s1, vector<int> p1, vector<int> w1, vector<int> l1){
n = n1;
s = s1;
p = p1;
w = w1;
l = l1;
}
ll simulate(int x, int z1){
ll z = ll(z1);
while(x!=n){
if(z < s[x]){
z += (ll)p[x];
x = l[x];
}
else{
z += s[x];
x = w[x];
}
}
return z;
}
