This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |