| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1345021 | yc11 | 던전 (IOI21_dungeons) | C++20 | 0 ms | 0 KiB |
#include<bits/stdc++.h>
#define int long long
using namespace std;
vector<int> s1;
vector<int> p1;
vector<int> w1;
vector<int> l1;
int N;
void init(int n, std::vector<int> s, std::vector<int> p, std::vector<int> w, std::vector<int> l) {
s1 = s;
p1 = p;
w1 = w;
l1 = l;
N = n;
return;
}
long long simulate(int x, int z) {
while (x!=N){
if (z>=s1[x]){
z+=s1[x];
x = w1[x];
}
else{
z+=p1[x];
x = l1[x];
}
}
return (long long )z;
}