제출 #829357

#제출 시각아이디문제언어결과실행 시간메모리
829357fatemetmhr던전 (IOI21_dungeons)C++17
11 / 100
7084 ms26672 KiB
// Be Name Khoda //


#include "dungeons.h"
#include <bits/stdc++.h>

using namespace std;

#define MAX(x, y)  ((x) > (y) ? (x) : (y))
#define MIN(x, y)  ((x) < (y) ? (x) : (y))
#define debug(x)   cerr << "(" << (#x) << "): " << (x) << endl;
#define all(x)     (x).begin(), (x).end()
#define fi         first
#define se         second
#define mp         make_pair

typedef long long ll;

const int maxn5 = 4e5 + 10;

int n;
int s[maxn5], p[maxn5], w[maxn5], l[maxn5];

void init(int nn, std::vector<int> ss, std::vector<int> pp, std::vector<int> ww, std::vector<int> ll) {
	n = nn;
	for(int i = 0; i < n; i++){
		s[i] = ss[i];
		p[i] = pp[i];
		w[i] = ww[i];
		l[i] = ll[i];
	}
	return;
}

long long simulate(int x, int z) {
	while(x < n){
		if(z < s[x]){
			z += p[x];
			x = l[x];
		}
		else{
			z += s[x];
			x = w[x];
		}
	}
	return z;
}

#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...