QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#140094 | #1144. Dungeons Game | littlecat# | 0 | 3ms | 16344kb | C++14 | 994b | 2023-08-15 05:40:31 | 2024-07-04 02:37:24 |
Judging History
answer
#include <vector>
using namespace std;
typedef vector<int> vi;
typedef long long ll;
#define mx 400000
int n; ll s[mx], p[mx]; int w[mx], l[mx];
int a[mx+1][25]; ll b[mx+1][25], c[mx+1], d[mx+1][25];
void init(int N, vi S, vi P, vi W, vi 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];
//follow lose-cycle, binary lift
//a = final location, b = gain, c = finish, d = min to escape
for (int i = 0; i < n; i++) a[i][0] = l[i], b[i][0] = p[i], d[i][0] = s[i];
a[n][0] = n;
for (int t = 1; t < 25; t++) for (int i = 0; i <= n; i++)
a[i][t] = a[a[i][t-1]][t-1], b[i][t] = b[i][t-1]+b[a[i][t-1]][t-1],
d[i][t] = min(d[i][t-1],d[a[i][t-1]][t-1]-b[i][t-1]);
for (int i = n-1; i >= 0; i--) c[i] = c[w[i]] + s[i];
}
ll simulate(int x, int z)
{
for (int t = 24; t >= 0; t--) if (z < d[x][t]) x = a[x][t], z += b[x][t];
if (z < s[x]) x = w[x], z += s[x];
return z + c[x];
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 11
Accepted
time: 0ms
memory: 14324kb
input:
b50747e9-747c-4fca-b3b0-62317b32d2f6 1 73 9829 6 1 0 0 2 0 7 0 2 0 2 0 6 0 2 0 6 0 2 0 7 0 7 0 10 0 1 0 9 0 5 0 5 0 7 0 5 0 9 0 3 0 8 0 9 0 8 0 6 0 4 0 1 0 9 0 8 0 10 0 10 0 1 0 8 0 8 0 8 0 7 0 3 0 10 0 4 0 2 0 9 0 4 0 1 0 3 0 6 0 10 0 10 0 10 0 1 0 1 0 10 0 1 0 5 0 9 0 2 0 6 0 8 0 9 0 6 0 6 0 6 0 2...
output:
f39eb8f7-7d10-4b4a-af02-d7aef3d4dd0a OK 19659 19658 19659 19659 19663 19659 19663 19659 19658 19658 19661 19658 19660 19662 19662 19658 19662 19660 19660 19659 19660 19659 19663 19661 19658 19660 19659 19661 19661 19658 19659 19659 19659 19658 19660 19661 19661 19659 19660 19661 19658 19660 19663 19...
result:
ok 75 lines
Test #2:
score: -11
Wrong Answer
time: 0ms
memory: 16088kb
input:
b50747e9-747c-4fca-b3b0-62317b32d2f6 10 86 1820 5250 4629 1552 6552 3205 7668 2419 6343 9299 8841 5649 9910 9479 9718 2612 7483 2360 7862 1567 8 8 9 5 6 9 8 8 9 10 4 6 4 1 4 6 8 7 4 7 4 7 3 10 4 5 2 10 2 4 0 10 3 4 3 1 0 6 0 4 5 8 9 4 4 5 5 10 7 6 6 5 1 10 8 10 6 1 4 4 9 1 8 7 6 4 5 2 5 3 4 1 5 2 5 ...
output:
f39eb8f7-7d10-4b4a-af02-d7aef3d4dd0a OK 39587 26551 39585 39590 39584 39590 26545 26542 39586 39584 33230 22785 39585 33232 22787 23509 33232 39590 23505 39584 22782 39587 23508 33224 33225 39581 33224 33228 23511 39586 22784 39583 23514 22787 26543 26547 33223 33225 39581 39583 22784 39581 22786 39...
result:
wrong answer 4th lines differ - expected: '30381', found: '26551'
Subtask #2:
score: 0
Wrong Answer
Test #7:
score: 0
Wrong Answer
time: 0ms
memory: 16340kb
input:
b50747e9-747c-4fca-b3b0-62317b32d2f6 1000 1000 1130998 3946545 6545866 7293696 9624001 5934576 91883 8467808 5293516 4377969 4270305 6396962 273361 88842 3015089 8325041 3690612 3735050 9510254 8527761 1038723 5522813 1877104 5699491 3708597 4192999 6479390 5728351 459885 627590 778790 9813273 44970...
output:
f39eb8f7-7d10-4b4a-af02-d7aef3d4dd0a OK 61652764 52883609 44046046 36688021 60762505 72733211 60812521 25145295 61643367 56621402 10140176 30551052 82806022 34643656 25758280 14843953 30318972 41098136 50889729 38925800 41083189 15432148 34308426 31453558 23471995 28309965 34859760 46638226 58490304...
result:
wrong answer 3rd lines differ - expected: '58554923', found: '61652764'
Subtask #3:
score: 0
Wrong Answer
Test #14:
score: 0
Wrong Answer
time: 3ms
memory: 16344kb
input:
b50747e9-747c-4fca-b3b0-62317b32d2f6 1000 1000 2918477 2918477 2918477 2918477 2918477 2918477 2918477 2918477 2918477 2918477 2918477 2918477 2918477 2918477 2918477 2918477 2918477 2918477 2918477 2918477 2918477 2918477 2918477 2918477 2918477 2918477 2918477 2918477 2918477 2918477 2918477 29184...
output:
f39eb8f7-7d10-4b4a-af02-d7aef3d4dd0a OK 17881661 33040130 34500795 25280961 28194570 23906798 15912230 30652931 28036550 24990418 20254260 16847281 36206803 24262421 30649405 24557488 26348424 25668821 27905635 24448869 27422275 16663870 17036501 18233622 15018428 21363378 20502535 17012171 21427171...
result:
wrong answer 5th lines differ - expected: '34604564', found: '34500795'
Subtask #4:
score: 0
Wrong Answer
Test #27:
score: 0
Wrong Answer
time: 0ms
memory: 14340kb
input:
b50747e9-747c-4fca-b3b0-62317b32d2f6 1000 1000 661 832 661 985 832 661 661 985 985 985 661 661 661 985 832 985 661 832 661 832 985 832 985 661 985 661 661 661 661 661 661 985 985 985 661 832 985 661 661 832 985 661 985 832 661 661 832 832 661 661 661 832 661 661 661 985 832 832 832 985 661 661 985 8...
output:
f39eb8f7-7d10-4b4a-af02-d7aef3d4dd0a OK 12085123 14848190 14102298 12411568 18181798 12353902 16883183 16573548 15256986 14233193 16697104 12045645 11936869 12224714 15445792 14438222 13284985 15439685 12136296 21100369 16425718 10706926 19114648 19277804 15159165 11647464 12142828 15122339 11526435...
result:
wrong answer 3rd lines differ - expected: '21024092', found: '12085123'
Subtask #5:
score: 0
Skipped
Dependency #1:
0%
Subtask #6:
score: 0
Skipped
Dependency #1:
0%