제출 #712617

#제출 시각아이디문제언어결과실행 시간메모리
712617danikoynov던전 (IOI21_dungeons)C++17
11 / 100
7017 ms29876 KiB
#include "dungeons.h"
#include <vector>
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

const int maxn = 4e5 + 10;

int n, w[maxn], l[maxn];
ll s[maxn], p[maxn];
void init(int N, std::vector<int> S, std::vector<int> P, std::vector<int> W, std::vector<int> L)
{
    n = N;
    for (int i = 0; i < n; i ++)
    {
        s[i] = S[i];
        p[i] = P[i];
        w[i] = W[i];
        l[i] = L[i];
    }
    return;
}

long long simulate(int x, int z)
{
    ll strength = z;
    while(x != n)
    {
        if (strength >= s[x])
        {
            strength += s[x];
            x = w[x];
        }
        else
        {
            strength += p[x];
            x = l[x];
        }
    }
    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...