제출 #454695

#제출 시각아이디문제언어결과실행 시간메모리
454695ogibogi2004던전 (IOI21_dungeons)C++17
11 / 100
7071 ms26696 KiB
#include "dungeons.h" #include <vector> #include <bits/stdc++.h> using namespace std; const int MAXN=4e5+6; int g1[MAXN]; int g2[MAXN],n1; int strength[MAXN]; int points[MAXN]; void init(int n, vector<int> s, vector<int> p, vector<int> w, vector<int> l) { n1=n; for(int i=0;i<n;i++) { points[i]=p[i]; strength[i]=s[i]; g1[i]=l[i]; g2[i]=w[i]; } } long long simulate(int x, int z) { for(;;) { if(x==n1)return z; if(z>=strength[x]) { z+=strength[x]; x=g2[x]; } else { z+=points[x]; x=g1[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...