QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#140347 | #1144. Dungeons Game | yahia# | 0 | 111ms | 7184kb | C++14 | 904b | 2023-08-15 19:03:45 | 2024-07-04 01:44:15 |
Judging History
answer
#include "dungeons.h"
#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
#pragma GCC optimize("-Ofast")
#include <bits/stdc++.h>
using namespace std;
typedef int in;
#define int long long
#define double long double
#define f first
#define s second
#define pb push_back
#define pp push
#define ceil(x,y) (x/y)+(x%y!=0)*(x*y<0?0:1)
#define floor(x,y) (x/y)+(x%y!=0)*(x*y<0?-1:0)
const int MAAX=1e18;
const int MOD=1e9+7;
const int MAX=1e9;
int n,last[400010];
vector<in> s,p,w,l;
void init(in N, vector<in> S, vector<in> P, vector<in> W, vector<in> L) {
n=N,s=S,p=P,w=W,l=L;
return;
}
int simulate(in x, in z) {
memset(last,0,sizeof last);
while(x<n){
if(last[x]){
int y=z-last[x];
int a=(s[x]-last[x])/y;
z+=a*y;
}
last[x]=z;
if(z>=s[x]){
z+=s[x];
x=w[x];
}
else{
z+=p[x];
x=l[x];
}
}
return z;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 6ms
memory: 7184kb
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 19664 19659 19659 19663 19659 19663 19659 19664 19664 19661 19664 19660 19662 19662 19664 19662 19660 19660 19659 19660 19659 19663 19661 19664 19660 19659 19661 19661 19664 19659 19659 19659 19664 19660 19661 19661 19659 19660 19661 19664 19660 19663 19...
result:
wrong answer 4th lines differ - expected: '19658', found: '19664'
Subtask #2:
score: 0
Time Limit Exceeded
Test #7:
score: 26
Accepted
time: 110ms
memory: 7032kb
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 58554923 59397831 43907143 30396423 65329773 72733211 63602617 61768587 62204954 56621402 17618012 34979569 81400240 40358892 34992290 14843953 33603468 41098136 50889729 38925800 41083189 15432148 39749093 31453558 23471995 55658052 9381381 47354455 58490304 ...
result:
ok 1002 lines
Test #8:
score: -26
Time Limit Exceeded
input:
b50747e9-747c-4fca-b3b0-62317b32d2f6 400000 50000 3 10 1 9 5 8 10 7 3 8 2 7 5 6 3 8 1 5 8 7 2 10 3 2 6 2 10 6 9 2 9 5 10 6 10 7 9 10 5 8 6 7 9 10 6 10 7 7 3 1 2 3 3 1 3 3 4 10 7 4 6 7 5 3 7 9 1 10 9 5 8 4 5 4 1 10 3 4 9 6 6 2 1 4 9 7 7 2 10 2 7 2 3 1 4 3 3 10 1 7 4 6 6 9 4 4 10 9 4 3 9 4 3 7 6 4 3 9...
output:
Unauthorized output
result:
Subtask #3:
score: 0
Time Limit Exceeded
Test #14:
score: 13
Accepted
time: 111ms
memory: 6848kb
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 34604564 25280961 28194570 23906798 15912230 29857216 28036550 24990418 20254260 16847281 36206803 19938498 34824909 24557488 26348424 25668821 22620286 24448869 27422275 16663870 17422116 22692168 15018428 21363378 17674438 14701572 21427171...
result:
ok 1002 lines
Test #15:
score: -13
Time Limit Exceeded
input:
b50747e9-747c-4fca-b3b0-62317b32d2f6 50000 50000 2671299 2671299 2671299 2671299 2671299 2671299 2671299 2671299 2671299 2671299 2671299 2671299 2671299 2671299 2671299 2671299 2671299 2671299 2671299 2671299 2671299 2671299 2671299 2671299 2671299 2671299 2671299 2671299 2671299 2671299 2671299 267...
output:
Unauthorized output
result:
Subtask #4:
score: 0
Runtime Error
Test #27:
score: 0
Runtime Error
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:
Unauthorized output
result:
Subtask #5:
score: 0
Skipped
Dependency #1:
0%
Subtask #6:
score: 0
Skipped
Dependency #1:
0%