#include "dungeons.h"
#include <vector>
int L[50100],W[50100],N,S[50100],P[50100];
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++)
L[i]=l[i],W[i]=w[i],S[i]=s[i],P[i]=p[i];
}
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 time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
10 ms |
3676 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
10 ms |
3640 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Runtime error |
90 ms |
35868 KB |
Execution killed with signal 11 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
25 ms |
5180 KB |
Output is correct |
3 |
Execution timed out |
7064 ms |
4956 KB |
Time limit exceeded |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
25 ms |
5180 KB |
Output is correct |
3 |
Execution timed out |
7064 ms |
4956 KB |
Time limit exceeded |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
25 ms |
5180 KB |
Output is correct |
3 |
Execution timed out |
7064 ms |
4956 KB |
Time limit exceeded |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Runtime error |
90 ms |
35868 KB |
Execution killed with signal 11 |
3 |
Halted |
0 ms |
0 KB |
- |