Submission #826416

#TimeUsernameProblemLanguageResultExecution timeMemory
826416arnold518Dungeons Game (IOI21_dungeons)C++17
11 / 100
7040 ms19768 KiB
#include "dungeons.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; const int MAXN = 4e5; const ll INF = 1e18; int N; int S[MAXN+10], P[MAXN+10], W[MAXN+10], L[MAXN+10]; void init(int _N, vector<int> _S, vector<int> _P, vector<int> _W, vector<int> _L) { N=_N; for(int i=1; i<=N; i++) { S[i]=_S[i-1]; P[i]=_P[i-1]; W[i]=_W[i-1]+1; L[i]=_L[i-1]+1; } } ll simulate(int now, int _x) { now++; ll x=_x; while(now<=N) { if(x>=S[now]) x+=S[now], now=W[now]; else x+=P[now], now=L[now]; } return x; }
#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...