제출 #441116

#제출 시각아이디문제언어결과실행 시간메모리
441116Quang던전 (IOI21_dungeons)C++17
11 / 100
7079 ms19872 KiB
#include "dungeons.h" #include <vector> #include <bits/stdc++.h> using namespace std; set<int> values; bool all_equal = true; int n; vector<int> s, p, w, l; void init(int N, std::vector<int> S, std::vector<int> P, std::vector<int> W, std::vector<int> L) { s = S; p = P; w = W; l = L; n = N; for (auto u : s) { values.insert(u); } for (int i = 0; i < n; i++) { all_equal &= (s[i] == p[i]); } } long long SolveAllEqual(int x, int z) { long long res = z; while (x != n) { if (res >= s[x]) { res += s[x]; x = w[x]; } else { res += p[x]; x = l[x]; } } return res; } long long SolveNaive() { return 0; } long long simulate(int x, int z) { return SolveAllEqual(x, z); // if (all_equal) return SolveAllEqual(x, z); // return SolveNaive(); }
#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...