QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#140354#1144. Dungeons Gameyahia#0 630ms9936kbC++141.4kb2023-08-15 19:26:152024-07-04 01:44:17

Judging History

你现在查看的是最新测评结果

  • [2024-07-04 01:44:17]
  • 评测
  • 测评结果:0
  • 用时:630ms
  • 内存:9936kb
  • [2023-08-15 19:26:15]
  • 提交

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],fin[400010],vis[400010],tk[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;
	for(int i=0;i<n;i++){
		if(!last[i]){
			int x=i,z=0;
			vector<int> v;
			while(1){
				vis[x]=1;
				z+=p[x];
				x=l[x];
				v.pb(x);
				if(x==i)
					break;
				else if(vis[x])
					goto a;
			}
			for(int j=0;j<v.size();j++)
				last[v[j]]=z;
			a:;
		}
		if(!fin[i]){
			int x=i,z=0;
			vector<int> v;
			v.pb(x);
			while(x<n){
				tk[x]=z;
				z+=s[x];
				x=w[x];
				if(x<n)
					v.pb(x);
			}
			for(int j=0;j<v.size();j++){
				fin[v[j]]=z-tk[v[j]];
			}
		}
	}
	return;
}

int simulate(in x, in z) {
	while(x<n){
		if(z>=s[x]){
			z+=fin[x];
			break;
		}
		else if(z+last[x]<=s[x]&&last[x]){
			int y=last[x];
			int a=(s[x]-z)/y;
			z+=a*y;
		}
		else{
			z+=p[x];
			x=l[x];
		}
	}
	return z;
}


详细

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 11
Accepted
time: 1ms
memory: 6064kb

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
Accepted
time: 1ms
memory: 6060kb

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
30381
39585
39782
39776
38713
30375
30372
38709
38707
25745
21992
39585
25747
22787
23130
28784
37734
23126
39584
21989
37731
23129
25739
25740
39581
25739
25743
23132
37730
22784
39775
23135
21994
30373
30377
25738
25740
39773
39775
22784
39581
21993
39...

result:

ok 88 lines

Test #3:

score: 0
Wrong Answer
time: 2ms
memory: 5896kb

input:

b50747e9-747c-4fca-b3b0-62317b32d2f6
2000 100
6 5 4 7 6 7 8 2 10 8 3 10 1 2 8 6 5 7 6 9 10 9 9 6 5 7 2 9 3 6 1 8 7 2 10 1 1 3 5 7 8 6 2 4 1 4 1 9 6 6 2 8 7 3 8 10 1 7 6 1 3 8 10 5 9 4 9 10 1 1 6 6 7 3 9 5 3 6 10 2 2 6 9 3 10 4 10 7 6 1 6 3 8 9 2 9 6 7 7 10 4 8 10 7 6 7 10 3 4 10 3 1 3 8 7 3 4 2 5 1 ...

output:

f39eb8f7-7d10-4b4a-af02-d7aef3d4dd0a
OK
24
3684
3761
1617
8916
92
736
348
6273
63
113
637
83
648
131
242
42
467
54
76
755
225
6606
406
7559
1112
49
43
5462
7112
359
3494
586
8880
4130
835
754
4004
120
8010
2458
3495
507
49
26
2624
4822
4229
58
264
657
81
656
119
1867
8231
54
10050
307
251
494
86
590...

result:

wrong answer 3rd lines differ - expected: '7992', found: '24'

Subtask #2:

score: 0
Wrong Answer

Test #7:

score: 0
Wrong Answer
time: 0ms
memory: 5864kb

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
25145295
62204954
56621402
17618012
34979569
81400240
40358892
34992290
14843953
33603468
41098136
50889729
38925800
41083189
15432148
39749093
31453558
23471995
28309965
34859760
47354455
58490304...

result:

wrong answer 10th lines differ - expected: '61768587', found: '25145295'

Subtask #3:

score: 0
Wrong Answer

Test #14:

score: 13
Accepted
time: 1ms
memory: 6140kb

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
Accepted
time: 18ms
memory: 9332kb

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:

f39eb8f7-7d10-4b4a-af02-d7aef3d4dd0a
OK
57444627
30638506
31612306
25428389
41281602
32571734
33830016
43854914
49556558
19628592
42889496
39731682
17955565
47360652
36351342
38170417
28981343
44668365
45347762
29769758
24486732
25948887
33222555
33033192
42479566
29471696
30285781
25081732
20379694...

result:

ok 50002 lines

Test #16:

score: 0
Wrong Answer
time: 630ms
memory: 9936kb

input:

b50747e9-747c-4fca-b3b0-62317b32d2f6
50000 50000
4822500 4822500 4822500 4822500 4822500 4822500 4822500 4822500 4822500 4822500 4822500 4822500 4822500 4822500 4822500 4822500 4822500 4822500 4822500 4822500 4822500 4822500 4822500 4822500 4822500 4822500 4822500 4822500 4822500 4822500 4822500 482...

output:

f39eb8f7-7d10-4b4a-af02-d7aef3d4dd0a
OK
1043445128
964143633
-1916503718
-1342191750
-1522972890
-1329374382
338993188
1453241671
-917120139
181475647
932883728
1346451410
1920079411
-2113914521
-1003967913
-1439239374
-1802759462
-941628218
343887233
-1160242558
-29567331
-66257861
-601454330
-1056...

result:

wrong answer 3rd lines differ - expected: '91237758344', found: '1043445128'

Subtask #4:

score: 0
Wrong Answer

Test #27:

score: 0
Wrong Answer
time: 1ms
memory: 5916kb

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
25399682
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%