Submission #441115

#TimeUsernameProblemLanguageResultExecution timeMemory
441115QuangDungeons Game (IOI21_dungeons)C++17
0 / 100
2 ms332 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 = s.size(); set<int> values; for (auto u : s) { values.insert(u); } for (int i = 0; i < n; i++) { all_equal &= (s[i] == p[i]); } if (values.size() <= 5) { } } 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) { 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...