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;
#define ll long long
const int mxN = 4e5 + 1;
vector<int> s, p, w, l;
int n;
int st;
void init(int on, vector<int> os, vector<int> op, vector<int> ow, vector<int> ol) {
n = on;
s = os; p = op; w = ow; l = ol;
bool isst2 = true;
for (int i = 0; i < n; i++) {
isst2 &= (s[i] == p[i]);
}
if (isst2) {
st = 2;
return;
} else if (n > 50000) {
st = 6;
return;
}
set<int> dists;
for (int i = 0; i < n; i++) {
dists.insert(s[i]);
if (dists.size() > 5) break;
}
if (dists.size() == 1) {
st = 3;
return;
} else if (dists.size() <= 5) {
st = 4;
return;
}
// 1 and 5 is ???
st = 1;
return;
}
ll int st1(int x, ll int z) {
while (x != n) {
if (z >= s[x]) {
z += s[x];
x = w[x];
} else {
z += p[x];
x = l[x];
}
}
return z;
}
ll int st2(int x, ll int z) {
}
long long simulate(int x, int z) {
return st1(x, z);
if (st == 1) return st1(x, z);
if (st == 2) return st2(x, z);
return 0;
}
Compilation message (stderr)
dungeons.cpp: In function 'long long int st2(int, long long int)':
dungeons.cpp:53:1: warning: no return statement in function returning non-void [-Wreturn-type]
53 | }
| ^
# | 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... |