QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#415897#8410. Splatanie ciągów [A]GuanYunchang2 39ms16296kbC++178.4kb2024-05-21 12:26:512024-05-21 12:28:50

详细

Subtask #1:

score: 1
Accepted

Test #1:

score: 1
Accepted
time: 0ms
memory: 3652kb

input:

1 1
1
2

output:

0 1 

result:

ok single line: '0 1 '

Test #2:

score: 0
Accepted
time: 1ms
memory: 5752kb

input:

2 1
2 3
1

output:

0 3 0 

result:

ok single line: '0 3 0 '

Test #3:

score: 0
Accepted
time: 1ms
memory: 5760kb

input:

1 3
1
4 2 3

output:

0 6 0 0 

result:

ok single line: '0 6 0 0 '

Test #4:

score: 0
Accepted
time: 1ms
memory: 5720kb

input:

3 4
4 6 7
2 1 3 5

output:

0 60 0 0 0 0 0 

result:

ok single line: '0 60 0 0 0 0 0 '

Test #5:

score: 0
Accepted
time: 1ms
memory: 7752kb

input:

10 10
13 18 7 4 15 1 10 12 5 8
17 20 14 3 16 9 6 2 19 11

output:

0 2741 284 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 

result:

ok single line: '0 2741 284 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #6:

score: 0
Accepted
time: 1ms
memory: 7744kb

input:

10 5
5 2 11 1 8 15 12 4 14 3
13 7 10 9 6

output:

0 765 60 0 0 0 0 0 0 0 0 0 0 0 0 

result:

ok single line: '0 765 60 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #7:

score: 0
Accepted
time: 1ms
memory: 7736kb

input:

9 10
14 7 6 3 1 4 11 16 18
12 10 9 5 2 8 13 15 17 19

output:

0 1592 746 109 28 0 0 0 0 0 0 0 0 0 0 0 0 0 0 

result:

ok single line: '0 1592 746 109 28 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #8:

score: 0
Accepted
time: 1ms
memory: 7800kb

input:

9 10
9 16 15 18 2 14 11 13 5
1 8 7 19 12 17 3 10 4 6

output:

0 2475 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 

result:

ok single line: '0 2475 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #9:

score: 0
Accepted
time: 2ms
memory: 9852kb

input:

10 10
2 4 8 9 10 11 12 14 16 17
1 3 5 6 7 13 15 18 19 20

output:

0 1597 1004 304 100 20 0 0 0 0 0 0 0 0 0 0 0 0 0 0 

result:

ok single line: '0 1597 1004 304 100 20 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Subtask #2:

score: 1
Accepted

Test #10:

score: 1
Accepted
time: 35ms
memory: 14296kb

input:

30 30
21 60 56 26 50 1 4 52 51 58 34 13 54 59 7 28 33 46 18 39 43 37 32 36 19 25 30 16 38 55
45 23 48 40 2 17 29 27 57 53 12 6 49 15 3 31 9 5 20 44 47 24 11 22 10 42 41 35 8 14

output:

0 149064 63399 3762 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 

result:

ok single line: '0 149064 63399 3762 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #11:

score: 0
Accepted
time: 24ms
memory: 14008kb

input:

26 30
39 46 51 22 6 18 42 56 17 21 12 54 7 33 2 35 23 4 41 31 44 47 38 55 36 25
15 24 30 9 50 48 32 49 26 16 19 34 52 37 29 53 8 1 3 43 45 14 5 11 40 28 20 27 10 13

output:

0 117880 42735 2600 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 

result:

ok single line: '0 117880 42735 2600 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #12:

score: 0
Accepted
time: 12ms
memory: 12068kb

input:

20 30
20 29 4 3 46 9 33 12 34 16 41 23 18 49 8 27 42 1 22 28
2 40 7 47 39 19 5 30 31 21 25 45 17 11 26 38 43 13 24 14 37 15 36 6 48 50 10 32 44 35

output:

0 77108 19422 1120 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 

result:

ok single line: '0 77108 19422 1120 0 0 0 0 0 0... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #13:

score: 0
Accepted
time: 31ms
memory: 15924kb

input:

29 30
45 41 37 36 34 32 21 18 16 15 13 11 7 3 2 9 23 25 31 39 42 46 47 48 52 54 57 58 59
56 55 51 43 40 38 35 28 24 22 14 8 6 4 1 5 10 12 17 19 20 26 27 29 30 33 44 49 50 53

output:

0 49187 82131 32026 15994 9635 5169 4611 1224 678 560 442 324 206 88 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 

result:

ok single line: '0 49187 82131 32026 15994 9635... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #14:

score: 0
Accepted
time: 31ms
memory: 16064kb

input:

30 29
25 22 38 32 33 1 58 15 52 48 50 34 39 27 40 36 44 19 37 9 31 2 16 8 26 7 56 41 45 12
28 21 54 43 55 17 30 14 20 18 59 46 51 3 35 5 42 29 57 11 47 24 49 23 53 10 13 4 6

output:

0 202275 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 

result:

ok single line: '0 202275 0 0 0 0 0 0 0 0 0 0 0... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #15:

score: 0
Accepted
time: 37ms
memory: 16140kb

input:

30 30
59 56 54 53 48 46 44 43 42 41 40 38 36 33 30 28 27 26 25 24 22 21 17 16 15 10 8 6 4 3
60 58 57 55 52 51 50 49 47 45 39 37 35 34 32 31 29 23 20 19 18 14 13 12 11 9 7 5 2 1

output:

0 44487 87654 35016 17978 10540 6702 4504 3014 2196 1434 1020 780 540 300 60 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 

result:

ok single line: '0 44487 87654 35016 17978 1054... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #16:

score: 0
Accepted
time: 38ms
memory: 15928kb

input:

30 30
3 49 41 35 33 16 12 17 26 32 60 59 56 50 31 25 9 1 22 23 39 37 34 27 19 6 4 15 11 8
20 29 21 13 7 58 57 54 52 51 48 47 10 28 45 36 14 5 2 38 40 42 44 55 53 46 43 30 24 18

output:

0 79069 85159 28733 17620 3994 1650 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 

result:

ok single line: '0 79069 85159 28733 17620 3994... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #17:

score: 0
Accepted
time: 38ms
memory: 16028kb

input:

30 30
27 4 19 13 31 20 34 38 42 44 47 50 51 52 54 55 59 23 30 32 26 17 12 46 45 41 37 28 5 2
60 58 57 56 49 40 9 10 16 21 35 15 22 6 3 7 53 48 36 29 25 14 11 1 18 33 43 24 39 8

output:

0 96660 78586 24374 11611 1910 3084 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 

result:

ok single line: '0 96660 78586 24374 11611 1910... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #18:

score: 0
Accepted
time: 0ms
memory: 13908kb

input:

27 3
1 2 5 6 7 13 14 15 17 19 20 21 28 29 27 26 25 24 23 22 18 16 12 11 10 9 4
8 3 30

output:

0 579 387 357 309 231 189 108 33 27 21 15 9 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 

result:

ok single line: '0 579 387 357 309 231 189 108 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #19:

score: 0
Accepted
time: 35ms
memory: 15988kb

input:

30 30
14 27 51 41 18 38 42 39 7 48 59 43 21 35 52 20 11 44 49 36 5 56 60 17 16 25 37 23 12 28
24 22 3 32 58 45 2 53 54 47 26 46 50 29 8 9 30 19 10 34 40 15 6 31 33 4 1 55 57 13

output:

0 127409 88816 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 

result:

ok single line: '0 127409 88816 0 0 0 0 0 0 0 0... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #20:

score: 0
Accepted
time: 39ms
memory: 16296kb

input:

30 30
31 23 22 12 40 53 60 13 5 1 7 32 45 37 33 26 41 55 56 42 29 18 52 57 58 21 16 11 19 50
49 34 8 4 30 38 47 43 25 15 17 28 36 9 6 3 20 27 46 39 10 2 14 24 59 54 48 35 44 51

output:

0 96399 70758 49068 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 

result:

ok single line: '0 96399 70758 49068 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Subtask #3:

score: 0
Time Limit Exceeded

Test #21:

score: 0
Time Limit Exceeded

input:

100 100
3 185 115 158 149 111 166 94 76 141 167 193 49 11 95 99 97 89 191 98 32 8 20 170 179 63 190 50 4 16 70 75 169 125 178 198 5 71 30 12 128 6 107 62 90 116 39 173 133 31 139 162 144 195 28 160 23 53 55 78 182 153 114 157 46 92 188 43 177 192 124 150 79 146 80 102 7 77 18 82 165 17 15 197 119 14...

output:


result:


Subtask #4:

score: 0
Runtime Error

Test #32:

score: 0
Runtime Error

input:

300 300
97 322 293 313 283 13 27 353 474 32 562 75 10 317 136 482 81 309 584 138 437 48 159 339 334 356 526 357 1 352 235 242 456 461 219 66 436 565 559 284 112 20 111 23 384 51 514 134 462 124 400 261 216 76 171 202 239 238 333 179 545 527 407 539 418 588 248 440 427 376 549 15 411 355 299 365 9 12...

output:


result:


Subtask #5:

score: 0
Runtime Error

Test #43:

score: 0
Runtime Error

input:

2000 2000
762 3148 1563 2539 1799 983 3993 1082 2912 3178 1908 2990 16 886 2973 823 913 243 357 850 2486 1588 2649 1893 1634 3691 150 996 3789 2922 2393 577 2316 924 3674 3636 910 2406 1483 1212 579 2442 1875 918 2039 928 2009 920 462 3898 1764 1592 1220 3893 1602 772 3485 1640 1940 2409 994 3201 62...

output:


result:


Subtask #6:

score: 0
Runtime Error

Test #55:

score: 0
Runtime Error

input:

8000 8000
7244 4104 4116 4733 1865 12849 14465 11794 1095 7219 5206 2781 11617 6866 9595 11983 14469 13258 2346 10847 5429 3414 4293 15825 10314 9643 14412 9550 6406 7816 13719 15736 5333 15692 12756 4329 2709 5284 5261 1707 11238 4301 13797 2131 12768 7126 9864 3229 3785 4314 8719 1117 646 8153 111...

output:


result:


Subtask #7:

score: 0
Runtime Error

Test #68:

score: 0
Runtime Error

input:

70000 70000
65040 83209 46810 43228 58294 97341 24577 26778 64585 34392 121492 59033 52566 63751 20036 135689 72762 109553 67967 51787 107523 120416 95354 49900 60667 110736 115814 16626 34683 37257 119483 91814 68147 131865 33293 114111 65264 122197 57479 111482 75492 84033 133075 73321 7539 47697 ...

output:


result:


Subtask #8:

score: 0
Runtime Error

Test #82:

score: 0
Runtime Error

input:

150000 150000
58983 100778 109945 294477 253435 1447 4311 110912 171122 212851 165373 102223 98625 274188 43059 196284 13184 232675 189091 37409 150201 227081 221065 161136 37343 47901 56955 197030 149843 137335 85230 291418 55155 84454 284046 96806 7342 94155 189355 60618 87506 281679 180207 125356...

output:


result:


Subtask #9:

score: 0
Runtime Error

Test #97:

score: 0
Runtime Error

input:

230000 230000
53349 24839 147164 179787 169500 138524 104308 71283 404918 183895 337401 419461 119619 389931 304997 360563 177306 435849 94845 192364 358356 159738 442086 88126 354608 167743 320160 221916 402274 207329 178240 316555 328700 13950 214332 286314 232082 56917 406912 123163 219788 153687...

output:


result:


Subtask #10:

score: 0
Runtime Error

Test #112:

score: 0
Runtime Error

input:

300000 300000
416773 186118 31247 38672 389294 339767 320108 250609 228574 232436 344414 316497 334835 318936 3172 393368 210300 145194 50617 423649 504469 6918 54400 485308 99748 556889 171790 488017 290307 560629 126324 57741 457051 257487 336091 524134 571207 573790 18672 361275 414336 343166 314...

output:


result: