QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#420757#67. Two TransportationsShui_Dream6 52ms15332kbC++202.3kb2024-05-24 21:44:232024-05-24 21:44:24

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 6
Accepted

Test #1:

score: 6
Accepted
time: 11ms
memory: 3972kb

input:

1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 ...

output:

-1
0 1 0 1 1 0 1 0 0 0 0 1 1 0 0 1 0 1 0 1 0 1 0 0 0 1 1 1 1 -1
1 0 1 0 1 1 0 1 1 1 0 0 0 0 0 1 1 0 0 1 -1
0 1 0 0 0 1 1 0 0 1 0 1 0 0 0 0 0 0 1 1 -1
1 0 1 1 0 0 1 0 1 0 1 0 0 1 0 1 1 0 1 1 -1
0 0 0 0 1 1 0 0 0 1 1 0 0 1 0 0 0 0 1 1 -1
0 0 1 0 0 0 1 0 0 1 0 0 0 0 1 0 0 0 1 1 -1
0 1 1 0 0 0 1 0 0 0 0...

input:


output:

0
2417
4435
3092
3018
2637
2136
3353
4117
2498
3522
3354
2776
1912
3232
3382
2310
2867
3546
2681
2605
3912
3045
3311
1307
2094
1352
3087
3487
3865
3223
4033
3647
2816
2468
1263
2756
3086
1735
3002
2385
2754
2837
3718
2891
2201
3478
3041
2726
3012
2634
2599
914
3509
4886
2317
4081
1993
2391
2749
3551...

result:

ok 2000 lines

Test #2:

score: 6
Accepted
time: 1ms
memory: 4108kb

input:

-1

output:

-1
-1

input:


output:

0

result:

ok single line: '0'

Test #3:

score: 6
Accepted
time: 12ms
memory: 4036kb

input:

1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 ...

output:

-1
1 0 1 0 0 0 0 1 0 1 0 0 1 1 0 0 1 0 0 1 1 1 1 1 0 0 0 1 1 -1
0 1 1 0 0 0 1 1 0 1 1 1 1 1 1 0 0 1 1 0 -1
0 1 0 1 1 1 0 0 1 1 1 1 0 1 0 1 0 1 0 1 -1
1 1 1 1 0 0 0 1 1 1 1 1 0 0 1 1 0 1 1 0 -1
1 0 1 1 0 1 0 0 0 0 1 1 0 1 1 0 1 0 0 1 -1
0 1 1 0 0 0 1 0 0 1 1 1 1 0 0 1 0 1 0 1 -1
1 1 1 0 0 1 1 0 1 0 1...

input:


output:

0
396305
456652
146790
45193
157298
290069
106100
444511
21734
496244
290946
448070
521134
597482
523834
252545
359818
556162
571923
74738
478958
576152
13164
3449
20598
191933
480791
549865
358479
85064
194758
230237
199091
240511
264959
272630
506097
508042
437901
345079
203449
238730
170044
35181...

result:

ok 2000 lines

Test #4:

score: 6
Accepted
time: 52ms
memory: 15332kb

input:

1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 ...

output:

-1
0 0 0 0 0 0 1 1 0 0 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 0 0 1 1 -1
1 0 0 1 1 0 1 1 1 1 1 0 0 0 0 0 0 0 1 1 -1
0 0 1 1 0 0 1 0 0 0 1 0 0 0 0 0 0 1 1 1 -1
1 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 1 1 0 -1
0 1 1 0 1 1 0 0 0 0 1 0 0 0 0 0 0 0 1 0 -1
1 1 1 1 0 0 0 0 1 1 1 0 0 0 0 0 0 0 1 1 -1
0 0 0 1 1 0 1 0 0 0 0...

input:


output:

0
3448
958
4288
8681
336
148
3141
6232
8253
676
8417
4301
7395
2583
2332
1931
5600
7707
6421
1048
3951
3221
1394
6384
4563
4421
2439
5778
5223
3112
7250
7987
2207
564
5006
4104
2143
1953
2367
3895
5571
5608
8505
3836
8925
1735
5333
2756
2154
3381
4181
7200
9010
3640
5480
3088
5385
4089
2931
8673
454...

result:

ok 2000 lines

Test #5:

score: 6
Accepted
time: 3ms
memory: 4196kb

input:

1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 ...

output:

-1
0 0 0 0 0 0 1 1 1 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 -1
0 0 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 0 1 0 -1
0 0 0 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 1 0 -1
0 0 0 0 1 0 1 1 0 1 1 0 0 0 0 0 0 0 1 1 -1
0 0 0 0 0 1 1 0 0 1 0 0 0 0 0 0 0 0 0 1 -1
0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 -1
0 0 0 0 0 0 0 1 1 1 1...

input:


output:

0
45
26
35
27
44
28
19
40
28
26
24
33
56
20
33
32
45
13
24
29
34
20
30
35
52
33
35
22
45
32
42
29
33
35
53
35
11
53
28
28
44
32
46
39
39
56
87
36
18
28
37
38
40
52
36
36
33
36
32
36
26
30
37
31
38
43
7
50
24
48
40
37
48
37
27
37
43
47
43
32
31
31
43
35
40
51
37
45
37
15
25
34
40
34
23
34
38
33
54

result:

ok 100 lines

Test #6:

score: 6
Accepted
time: 13ms
memory: 5752kb

input:

1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 1 1 ...

output:

-1
0 0 0 0 0 0 0 1 1 0 0 1 1 1 0 1 0 0 1 1 0 0 0 0 0 1 0 1 1 -1
1 0 1 1 0 0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 -1
1 0 1 1 1 0 0 0 1 1 1 0 0 0 0 0 0 1 0 0 -1
1 1 1 0 0 0 1 1 0 1 1 0 0 0 0 0 0 0 1 0 -1
0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 1 1 -1
1 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 -1
0 0 0 1 0 1 1 1 1 0 1...

input:


output:

0
170
114
124
149
133
109
128
102
102
129
94
138
137
50
153
93
92
127
100
145
136
112
155
172
104
114
132
136
140
139
111
135
24
74
117
99
115
107
87
138
96
76
174
132
110
101
134
128
99
93
82
128
94
102
97
123
160
116
151
104
84
98
220
145
126
144
74
132
148
81
103
138
161
133
88
81
127
122
167
102...

result:

ok 2000 lines

Subtask #2:

score: 0
Wrong Answer

Test #7:

score: 8
Accepted
time: 0ms
memory: 3848kb

input:

-1

output:

-1
-1

input:


output:

0

result:

ok single line: '0'

Test #8:

score: 8
Accepted
time: 12ms
memory: 3952kb

input:

1 1 1 1 1 1 1 1 1 -1
1 0 1 0 0 0 1 1 1 0 1 0 1 0 0 1 0 1 1 0 1 1 1 1 1 1 1 1 1 -1
0 1 0 0 0 0 1 1 1 1 0 0 1 0 0 1 1 0 1 0 1 1 1 1 1 1 1 1 1 -1
0 1 1 1 1 1 0 1 0 1 1 1 1 1 0 0 1 0 1 0 1 1 1 1 1 1 1 1 1 -1
1 0 0 1 1 1 0 0 0 1 0 0 1 0 1 0 1 1 0 0 1 1 1 1 1 1 1 1 1 -1
1 1 0 0 1 1 1 1 0 1 1 1 0 1 1 0 0 0...

output:

-1
0 1 1 0 1 0 1 0 1 0 0 1 0 0 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 -1
1 0 0 0 1 0 0 0 0 0 1 0 1 1 0 0 1 1 0 1 1 1 1 1 1 1 1 1 1 -1
1 1 1 1 0 0 1 0 0 1 0 1 0 0 1 0 0 1 1 0 1 1 1 1 1 1 1 1 1 -1
1 1 1 0 1 0 0 1 0 1 0 1 1 0 1 0 0 0 1 1 1 1 1 1 1 1 1 1 1 -1
1 0 1 0 0 0 0 0 1 1 1 1 1 0 1 0 1 1 1 1 1 1 1 1 1 1 1...

input:


output:

0
128264
331628
384182
208153
525372
572423
144082
259414
406719
308409
557889
129397
285792
216221
486927
571225
149599
317887
440746
229109
307465
104346
97136
445388
611196
462442
152511
595507
317479
409647
118010
508691
325383
250598
85753
552333
387494
470667
87406
390547
180339
101478
64178
2...

result:

ok 2000 lines

Test #9:

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

input:

0 1 1 1 1 1 1 0 1 -1
1 0 1 0 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 0 -1
1 1 1 1 0 1 1 1 1 -1
1 1 0 1 0 1 0 0 1 0 1 1 1 1 1 0 0 1 1 1 0 1 0 0 0 0 0 1 0 -1
0 0 1 0 1 0 1 0 1 1 0 0 1 1 0 1 1 0 1 0 -1
0 1 0 0 0 1 0 1 1 0 1 1 1 1 0 0 0 0 1 1 -1
0 1 0 1 0 0 1 1 1 -1
-1

output:

-1
1 1 1 1 1 1 1 1 1 -1
1 0 1 1 0 1 1 0 1 0 1 1 0 1 0 0 1 0 0 1 0 1 1 0 0 1 1 1 0 -1
1 1 0 0 1 0 0 1 1 0 1 1 1 1 1 1 1 1 1 1 -1
1 1 1 0 0 0 0 1 0 -1
1 0 1 0 0 0 0 0 0 -1
1 1 0 1 1 0 0 0 0 1 1 0 0 1 1 0 0 0 1 1 0 1 0 1 0 0 1 1 1 -1
-1
-1

input:


output:

0
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1...

result:

wrong answer 2nd lines differ - expected: '146596', found: '1000000000'

Subtask #3:

score: 0
Wrong Answer

Test #14:

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

input:

1 0 0 1 1 1 0 0 1 -1
0 0 0 0 1 1 1 0 1 0 0 0 0 0 0 0 0 0 1 0 -1
0 1 1 0 0 1 0 1 0 0 0 0 0 1 0 0 1 1 0 1 -1
0 0 0 0 0 0 1 0 1 0 0 1 0 1 1 1 0 0 0 1 -1
1 0 0 1 1 0 1 1 1 -1
0 1 0 1 1 1 0 1 1 -1
0 1 0 0 0 1 1 0 0 -1
0 0 0 1 1 1 1 0 0 -1
0 0 0 0 0 1 1 0 1 1 1 0 0 0 0 1 0 0 1 0 0 0 0 0 1 1 1 0 1 -1
1 0 0...

output:

-1
1 1 0 1 0 0 1 0 1 -1
0 0 1 1 0 1 1 0 0 -1
0 0 1 1 0 1 0 1 0 -1
0 0 0 0 1 1 1 0 1 0 1 1 1 1 1 1 0 1 1 0 0 0 1 1 1 1 1 0 0 -1
0 1 1 1 0 1 1 0 1 0 0 0 0 0 1 0 1 1 1 1 -1
1 1 1 0 1 1 1 1 0 0 0 0 0 1 0 1 0 0 0 0 -1
1 1 0 0 0 1 0 1 1 0 0 0 0 0 1 0 1 1 1 1 -1
1 1 0 1 1 0 1 0 0 1 0 0 0 0 1 0 1 1 1 1 -1
0...

input:


output:

0
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
392
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
10000000...

result:

wrong answer 2nd lines differ - expected: '3328', found: '1000000000'

Subtask #4:

score: 0
Wrong Answer

Test #24:

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

input:

1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 0 0 1 0 1 0 1 1 -1
0 1 1 1 1 0 1 1 0 0 0 0 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 0 0 -1
0 0 1 1 0 0 1 0 0 -1
0 0 1 0 1 0 0 0 1 -1
0 0 0 0 0 0 1 1 1 0 1 1 0 0 0 1 1 1 0 0 0 0 0 0 0 1 1 1 0 -1
0 0 0 1 0 0 0 0 1 1 1 0 0 1 1 1 0 0 1 0 -1
0 0 0 0 1 1 0 1 1 0 0 1 1 1 1 ...

output:

-1
0 1 0 0 1 0 0 1 1 0 0 1 1 0 0 1 0 0 1 0 0 1 1 1 0 1 1 1 0 -1
0 0 0 0 1 1 0 0 1 1 1 0 0 0 1 1 0 1 0 1 -1
0 0 0 1 0 1 0 1 1 1 1 1 0 0 0 0 1 0 1 1 -1
0 0 0 0 1 0 1 0 1 0 0 0 0 0 1 1 1 0 1 0 0 0 0 0 1 0 0 1 1 -1
0 1 1 0 1 1 0 0 1 0 0 0 0 0 1 1 1 1 0 0 -1
0 1 0 0 0 1 0 0 0 1 0 0 0 0 1 0 1 1 0 0 -1
0 0...

input:


output:

0
1000000000
1000000000
1168
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000...

result:

wrong answer 2nd lines differ - expected: '1881', found: '1000000000'

Subtask #5:

score: 0
Wrong Answer

Test #38:

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

input:

0 0 1 0 1 1 1 1 0 -1
0 1 1 1 0 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 0 0 1 0 1 1 0 1 -1
0 1 1 1 1 1 0 0 1 0 0 0 1 0 0 1 0 1 1 0 1 0 0 1 0 0 1 0 0 -1
0 1 1 0 0 1 1 0 1 0 1 0 0 1 0 0 0 1 1 1 -1
0 1 0 1 1 1 1 0 1 1 1 0 1 0 0 0 0 0 1 1 -1
0 0 1 0 0 1 1 0 0 0 0 1 1 0 0 0 0 1 1 0 1 0 0 1...

output:

-1
1 1 1 1 1 1 1 1 1 -1
1 0 1 1 0 1 1 0 1 0 1 1 0 1 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 -1
0 1 1 0 1 1 1 0 0 1 0 0 0 0 1 1 0 1 0 0 -1
0 1 1 1 1 1 0 0 0 1 0 1 1 1 1 1 1 1 1 1 -1
1 1 0 1 0 0 0 1 0 -1
0 0 1 1 1 1 1 1 0 -1
0 0 0 1 1 0 1 1 1 0 1 0 0 1 0 1 0 1 1 1 1 0 1 0 0 0 0 0 1 -1
0 1 1 1 1 0 1 0 1 0 0 0 0 ...

input:


output:

0
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
2661
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
2491
1000000000
1000000000
1000000000
1000000000
1000000000
10...

result:

wrong answer 2nd lines differ - expected: '3467', found: '1000000000'

Subtask #6:

score: 0
Wrong Answer

Test #51:

score: 0
Wrong Answer
time: 3ms
memory: 4236kb

input:

1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
0 0 0 1 0 1 1 0 0 -1
0 0 0 0 0 0 0 0 1 0 1 0 0 0 1 1 0 0 1 1 0 0 0 1 0 1 0 1 0 -1
0 1 1 0 0 1 1 0 1 1 0 1 0 0 1 1 0 0 0 1 -1
0 1 0 0 1 0 1 0 0 1 1 0 0 0 0 1 0 1 0 0 -1
0 1 1 0 1 1 0 0 0 1 0 0 0 0 1 0 0 1 1 1 -1
0 0 0 0 1 1 1 1 0 0 1 1 0 1 1 0 0 0 0 1 0 0 0 0...

output:

-1
0 1 0 1 1 0 0 0 0 0 1 0 1 0 1 1 1 1 1 0 1 0 1 0 0 1 0 1 0 -1
0 1 1 1 0 1 0 1 1 1 1 0 0 0 0 0 0 0 0 1 -1
0 1 1 0 1 1 0 1 0 0 0 1 1 1 1 1 1 1 1 1 -1
1 1 1 1 1 1 1 1 1 -1
1 0 1 0 0 1 1 1 0 -1
0 0 0 0 1 1 1 0 1 -1
0 0 0 0 0 1 0 0 1 0 0 0 1 1 0 0 0 0 1 0 0 0 1 1 1 1 0 1 1 -1
0 0 1 0 1 1 1 0 1 -1
0 0 1...

input:


output:

0
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1609
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000...

result:

wrong answer 2nd lines differ - expected: '4745', found: '1000000000'

Subtask #7:

score: 0
Wrong Answer

Test #64:

score: 0
Wrong Answer
time: 3ms
memory: 4404kb

input:

1 1 1 1 1 0 0 0 0 -1
1 0 0 0 1 1 1 0 1 0 1 1 0 0 0 1 1 1 1 0 -1
1 0 0 0 0 1 1 0 1 0 0 1 1 1 0 1 0 1 1 1 -1
0 1 0 0 1 0 1 1 1 0 0 0 0 1 1 0 0 1 1 0 -1
1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 1 1 0 1 0 -1
0 1 1 1 1 1 0 0 0 1 1 0 0 1 1 1 1 1 0 1 -1
0 0 0 0 0 1 0 1 0 1 1 1 1 1 0 1 0 1 1 1 -1
1 1 1 0 1 1 1 0 0 1 1...

output:

-1
1 1 1 1 1 0 0 1 1 -1
1 1 1 1 1 0 0 1 1 -1
1 1 1 1 1 0 0 1 1 -1
1 0 0 0 1 0 1 0 0 -1
1 0 0 0 1 0 0 1 1 -1
0 0 1 1 1 1 1 1 1 -1
1 1 1 1 0 1 0 0 1 -1
0 1 1 1 1 1 0 1 1 -1
1 1 0 0 0 0 0 0 0 -1
1 1 1 1 0 0 1 1 0 -1
0 1 0 0 0 0 0 0 1 -1
1 1 0 1 0 1 1 1 0 -1
1 1 1 0 1 0 1 0 0 -1
1 1 0 0 0 1 1 0 1 -1
1 1...

input:


output:

0
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1...

result:

wrong answer 2nd lines differ - expected: '25855', found: '1000000000'