QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#302032 | #7956. Walk Swapping | HuangHanSheng | TL | 355ms | 3608kb | C++17 | 1.6kb | 2024-01-10 15:36:20 | 2024-01-10 15:36:20 |
Due to the privacy settings of the submitter, you are not allowed to view this code.
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3484kb
input:
4 4 3 2 1 3 4 2 1
output:
1
result:
ok single line: '1'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3472kb
input:
6 2 1 1 2 2 1 1 2 2 2 1 1
output:
7
result:
ok single line: '7'
Test #3:
score: 0
Accepted
time: 1ms
memory: 3428kb
input:
6 4 1 3 6 2 5 6 2 1 3 4 5
output:
-1
result:
ok single line: '-1'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3492kb
input:
4 1 2 3 4 4 2 1 3
output:
2
result:
ok single line: '2'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3544kb
input:
6 4 1 3 6 2 5 6 2 5 3 4 1
output:
13
result:
ok single line: '13'
Test #6:
score: 0
Accepted
time: 1ms
memory: 3472kb
input:
6 4 1 3 3 2 5 3 2 5 3 4 1
output:
12
result:
ok single line: '12'
Test #7:
score: 0
Accepted
time: 1ms
memory: 3552kb
input:
4 4 3 2 1 1 3 2 4
output:
1
result:
ok single line: '1'
Test #8:
score: 0
Accepted
time: 0ms
memory: 3428kb
input:
5 4 3 5 2 1 1 3 5 4 2
output:
2
result:
ok single line: '2'
Test #9:
score: 0
Accepted
time: 0ms
memory: 3428kb
input:
5 4 3 5 2 1 1 4 3 5 2
output:
4
result:
ok single line: '4'
Test #10:
score: 0
Accepted
time: 0ms
memory: 3484kb
input:
5 1 1 1 2 1 2 1 1 1 1
output:
2
result:
ok single line: '2'
Test #11:
score: 0
Accepted
time: 1ms
memory: 3432kb
input:
4 4 3 2 1 1 3 2 4
output:
1
result:
ok single line: '1'
Test #12:
score: 0
Accepted
time: 0ms
memory: 3512kb
input:
4 4 3 2 1 1 3 4 2
output:
2
result:
ok single line: '2'
Test #13:
score: 0
Accepted
time: 1ms
memory: 3504kb
input:
10 2 3 1 1 3 4 5 5 6 1 1 1 3 4 5 3 5 1 7 2
output:
-1
result:
ok single line: '-1'
Test #14:
score: 0
Accepted
time: 0ms
memory: 3552kb
input:
5 1 4 5 3 2 5 3 2 1 4
output:
8
result:
ok single line: '8'
Test #15:
score: 0
Accepted
time: 0ms
memory: 3440kb
input:
5 1 2 3 4 5 5 2 1 3 4
output:
3
result:
ok single line: '3'
Test #16:
score: 0
Accepted
time: 0ms
memory: 3476kb
input:
10 1 2 3 4 5 6 7 8 9 10 8 4 2 3 1 5 7 6 9 10
output:
-1
result:
ok single line: '-1'
Test #17:
score: 0
Accepted
time: 0ms
memory: 3424kb
input:
10 1 2 3 2 2 2 1 1 1 1 2 1 1 1 1 1 2 2 3 2
output:
41
result:
ok single line: '41'
Test #18:
score: 0
Accepted
time: 0ms
memory: 3488kb
input:
10 1 1 1 2 2 4 4 4 2 2 1 1 2 2 4 4 2 2 1 4
output:
12
result:
ok single line: '12'
Test #19:
score: 0
Accepted
time: 1ms
memory: 3516kb
input:
12 3 3 3 2 2 2 4 4 2 2 1 3 3 3 2 2 4 4 2 2 2 1 3 3
output:
13
result:
ok single line: '13'
Test #20:
score: 0
Accepted
time: 0ms
memory: 3440kb
input:
12 3 3 2 2 2 2 4 4 2 2 1 2 2 2 2 2 4 4 2 2 2 1 3 3
output:
19
result:
ok single line: '19'
Test #21:
score: 0
Accepted
time: 0ms
memory: 3484kb
input:
12 3 3 2 4 2 2 4 4 2 2 1 2 2 2 2 2 4 4 2 2 4 1 3 3
output:
-1
result:
ok single line: '-1'
Test #22:
score: 0
Accepted
time: 0ms
memory: 3436kb
input:
20 3 4 4 5 1 2 3 2 5 1 1 5 3 2 4 5 1 2 3 5 2 3 5 4 4 5 1 2 3 2 5 3 1 1 5 3 2 4 5 1
output:
49
result:
ok single line: '49'
Test #23:
score: 0
Accepted
time: 1ms
memory: 3440kb
input:
20 3 4 4 5 1 2 3 2 5 1 1 5 3 2 4 5 1 2 3 5 3 2 3 4 5 1 2 3 5 4 4 5 1 2 3 2 5 1 1 5
output:
158
result:
ok single line: '158'
Test #24:
score: 0
Accepted
time: 1ms
memory: 3440kb
input:
100 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 99 1...
output:
109
result:
ok single line: '109'
Test #25:
score: 0
Accepted
time: 0ms
memory: 3492kb
input:
100 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 100 ...
output:
89
result:
ok single line: '89'
Test #26:
score: 0
Accepted
time: 1ms
memory: 3444kb
input:
100 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 51 5...
output:
4924
result:
ok single line: '4924'
Test #27:
score: 0
Accepted
time: 0ms
memory: 3484kb
input:
100 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 51 5...
output:
4905
result:
ok single line: '4905'
Test #28:
score: 0
Accepted
time: 1ms
memory: 3452kb
input:
100 1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4 5 5 5 5 5 6 6 6 6 6 7 7 7 7 7 8 8 8 8 8 9 9 9 9 9 10 10 10 10 10 11 11 11 11 11 12 12 12 12 12 13 13 13 13 13 14 14 14 14 14 15 15 15 15 15 16 16 16 16 16 17 17 17 17 17 18 18 18 18 18 19 19 19 19 19 20 20 20 20 20 9 9 9 9 9 10 10 10 10 10 11 11 11 11 11 1...
output:
3990
result:
ok single line: '3990'
Test #29:
score: 0
Accepted
time: 1ms
memory: 3440kb
input:
100 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 ...
output:
125
result:
ok single line: '125'
Test #30:
score: 0
Accepted
time: 1ms
memory: 3492kb
input:
100 1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4 5 5 5 5 5 6 6 6 6 6 7 7 7 7 7 8 8 8 8 8 9 9 9 9 9 10 10 10 10 10 11 11 11 11 11 12 12 12 12 12 13 13 13 13 13 14 14 14 14 14 15 15 15 15 15 16 16 16 16 16 17 17 17 17 17 18 18 18 18 18 19 19 19 19 19 20 20 20 20 20 9 9 9 9 9 10 10 10 10 10 11 11 11 15 11 1...
output:
-1
result:
ok single line: '-1'
Test #31:
score: 0
Accepted
time: 1ms
memory: 3456kb
input:
100 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 ...
output:
79
result:
ok single line: '79'
Test #32:
score: 0
Accepted
time: 1ms
memory: 3448kb
input:
100 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 ...
output:
-1
result:
ok single line: '-1'
Test #33:
score: 0
Accepted
time: 0ms
memory: 3488kb
input:
100 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 ...
output:
0
result:
ok single line: '0'
Test #34:
score: 0
Accepted
time: 14ms
memory: 3512kb
input:
1000 458 51 4 190 103 444 401 456 34 970 169 517 283 66 571 282 233 161 32 376 168 616 993 347 213 597 334 652 471 532 552 987 353 613 665 305 477 632 331 293 939 598 175 813 10 890 423 560 502 857 277 18 283 461 6 231 233 648 929 75 896 807 900 2 582 84 81 107 255 145 909 562 492 58 218 575 7 610 6...
output:
243210
result:
ok single line: '243210'
Test #35:
score: 0
Accepted
time: 14ms
memory: 3456kb
input:
1000 323 302 194 991 814 729 763 611 294 128 752 772 136 693 300 575 118 965 888 999 288 837 534 470 436 195 8 958 448 216 697 295 53 341 577 460 543 724 79 593 490 800 218 336 7 448 401 716 7 920 740 21 87 208 202 422 812 528 196 475 633 732 170 423 975 901 412 117 829 457 420 941 664 644 858 473 9...
output:
243013
result:
ok single line: '243013'
Test #36:
score: 0
Accepted
time: 138ms
memory: 3572kb
input:
3000 2057 2074 2349 1090 597 671 2074 92 892 304 1749 2393 935 2200 2859 293 2392 127 1960 1991 1842 2447 1783 1669 599 1936 887 1490 296 478 2334 250 864 1697 1833 325 1801 2950 2704 51 1868 2860 820 1495 1123 1 2122 2135 1826 294 612 1771 2181 160 1358 587 931 409 934 2622 516 2199 399 1008 1446 3...
output:
1788777
result:
ok single line: '1788777'
Test #37:
score: 0
Accepted
time: 353ms
memory: 3492kb
input:
3000 324 151 600 776 956 914 289 189 861 149 898 483 603 415 202 265 317 689 383 59 610 507 832 589 689 135 67 296 941 795 53 539 385 469 824 742 232 843 890 363 768 144 132 991 472 142 671 655 327 648 310 46 47 654 344 326 91 79 852 109 620 514 43 114 538 374 160 296 897 755 995 514 746 304 830 455...
output:
1100867
result:
ok single line: '1100867'
Test #38:
score: 0
Accepted
time: 147ms
memory: 3536kb
input:
3000 1991 2302 2034 674 671 2189 1348 2644 189 991 1293 60 489 514 1203 1906 2376 2579 482 2083 2116 2055 278 1787 445 1557 1583 373 1959 523 322 2449 1643 1654 734 24 1211 1758 2876 261 1936 2105 1482 2069 1894 974 673 392 1739 1181 758 576 1004 2645 1782 2817 152 2654 2694 2553 1897 2937 130 1178 ...
output:
742350
result:
ok single line: '742350'
Test #39:
score: 0
Accepted
time: 355ms
memory: 3608kb
input:
3000 527 569 638 129 325 581 270 91 113 516 804 284 17 367 470 304 847 659 40 504 483 25 109 300 268 189 9 409 405 337 957 468 573 515 115 429 905 252 170 134 998 786 564 742 410 512 598 641 234 884 231 859 530 170 349 653 704 439 381 215 505 337 521 423 88 941 951 17 892 960 263 991 642 482 5 418 8...
output:
1930377
result:
ok single line: '1930377'
Test #40:
score: -100
Time Limit Exceeded
input:
3000 3 72 35 97 25 59 36 93 74 34 78 47 60 99 94 62 82 66 81 66 79 50 18 24 83 39 97 27 17 69 43 40 88 84 34 73 33 60 46 61 88 59 85 79 43 1 27 8 39 11 24 53 72 47 66 78 15 79 89 84 54 84 94 21 12 44 48 1 5 27 13 67 64 27 92 86 80 90 21 61 40 57 70 50 34 86 84 86 9 25 38 75 81 82 1 50 72 25 15 15 7 ...