#include "dungeons.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int nx=4e5+5;
int N;
vector<ll> S(nx), P(nx), W(nx), L(nx);
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];
}
long long simulate(int x, int z) {
ll pw=z;
while (x!=N)
{
//cout<<"debug "<<x<<' '<<pw<<'\n';
if (pw>S[x]) pw+=S[x], x=W[x];
else pw+=P[x], x=L[x];
}
return pw;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
4 ms |
12892 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
12892 KB |
Output is correct |
2 |
Execution timed out |
7038 ms |
33044 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
12892 KB |
Output is correct |
2 |
Correct |
34 ms |
16964 KB |
Output is correct |
3 |
Correct |
2104 ms |
17088 KB |
Output is correct |
4 |
Correct |
2524 ms |
16336 KB |
Output is correct |
5 |
Incorrect |
1683 ms |
16216 KB |
Output isn't correct |
6 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
12892 KB |
Output is correct |
2 |
Correct |
34 ms |
16964 KB |
Output is correct |
3 |
Correct |
2104 ms |
17088 KB |
Output is correct |
4 |
Correct |
2524 ms |
16336 KB |
Output is correct |
5 |
Incorrect |
1683 ms |
16216 KB |
Output isn't correct |
6 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
12892 KB |
Output is correct |
2 |
Correct |
34 ms |
16964 KB |
Output is correct |
3 |
Correct |
2104 ms |
17088 KB |
Output is correct |
4 |
Correct |
2524 ms |
16336 KB |
Output is correct |
5 |
Incorrect |
1683 ms |
16216 KB |
Output isn't correct |
6 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
12892 KB |
Output is correct |
2 |
Execution timed out |
7038 ms |
33044 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |