Submission #615583

#TimeUsernameProblemLanguageResultExecution timeMemory
615583Clan328Dungeons Game (IOI21_dungeons)C++17
11 / 100
7004 ms20300 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef pair<int, int> pii; vector<pair<int, int>> G, W; void init(int n, vi s, vi p, vi w, vi l) { G = vector<pii>(n); W = vector<pii>(n); for (int i = 0; i < n; i++) { G[i] = {w[i], l[i]}; W[i] = {s[i], p[i]}; } } ll simulate(int x, int z) { int n = G.size(); ll strength = z; for (int i = x; i != n; ) { if (strength >= W[i].first) { strength += W[i].first; i = G[i].first; } else { strength += W[i].second; i = G[i].second; } } return strength; }
#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...