Cody

# Problem 1646. Kurchan 3x3 - Optimal Score

Solution 2129770

Submitted on 15 Feb 2020 by Augusto Mazzei
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
tic m = kurchan_3x3 toc p=[1 4 7 2 5 8 3 6 9 1 2 3 4 5 6 7 8 9 1 5 9 4 8 3 7 2 6 7 5 3 8 6 1 9 4 2]; assert(isequal((1:9)',unique(m(:)))) % check use 1 thru 9 mp=prod(m(p),2); K=max(mp)-min(mp) % display K score % simplified Kurchan scoring for 3x3 assert(K<=198) % Pretty certain 198 is best possible, allow better score

idx = Columns 1 through 15 3605 3748 3841 4055 4198 4291 4325 4468 4561 4775 4918 5011 8651 8812 8975 Columns 16 through 30 9001 9232 9307 9371 9532 9695 9721 9952 10027 13001 13007 13145 13151 13276 13300 Columns 31 through 45 13402 13426 13447 13477 13567 13597 17289 17291 17452 17454 17615 17639 17641 17642 17827 Columns 46 through 60 17872 17947 17992 22372 22374 22449 22451 22656 22680 22705 22706 22869 22910 22989 23030 Columns 61 through 75 26724 26748 26850 26874 26895 26901 27039 27045 27170 27200 27290 27320 30270 30363 30506 Columns 76 through 90 30720 30813 30956 31014 31089 31320 31346 31509 31670 35310 35403 35546 35760 35853 35996 Columns 91 through 105 36054 36129 36360 36386 36549 36710 43947 44042 44190 44397 44492 44640 44667 44762 44910 Columns 106 through 120 45117 45212 45360 48273 48275 48455 48479 48532 48534 48607 48608 48763 48826 48883 48946 Columns 121 through 135 52577 52583 52756 52780 52865 52871 53008 53032 53041 53101 53161 53221 59081 59231 59356 Columns 136 through 150 59506 59527 59677 59801 59951 60076 60226 60247 60397 61998 62022 62055 62061 62250 62274 Columns 151 through 165 62343 62349 62426 62486 62546 62606 66298 66300 66456 66480 66489 66491 66649 66650 66765 Columns 166 through 180 66824 66885 66944 70564 70705 70805 71014 71155 71255 72804 72954 72975 73125 73250 73400 Columns 181 through 195 75604 75745 75845 76054 76195 76295 77844 77994 78015 78165 78290 78440 84291 84368 84597 Columns 196 through 210 84630 84788 84954 85011 85088 85317 85350 85508 85674 88617 88619 88773 88797 88807 88808 Columns 211 through 225 88972 88974 89084 89148 89204 89268 92177 92183 92356 92380 92465 92471 92608 92632 92641 Columns 226 through 240 92701 92761 92821 97278 97302 97335 97341 97530 97554 97623 97629 97706 97766 97826 97886 Columns 241 through 255 104441 104591 104716 104866 104887 105037 105161 105311 105436 105586 105607 105757 106594 106596 106774 Columns 256 through 270 106798 106849 106850 106929 106931 107087 107143 107207 107263 110890 111049 111214 111245 111469 111551 Columns 271 through 285 113844 113994 114015 114165 114290 114440 115930 116089 116254 116285 116509 116591 118884 119034 119055 Columns 286 through 300 119205 119330 119480 123921 123945 124047 124071 124094 124100 124238 124244 124374 124404 124494 124524 Columns 301 through 315 128235 128259 128294 128300 128487 128511 128582 128588 128670 128730 128790 128850 132555 132579 132614 Columns 316 through 330 132620 132807 132831 132902 132908 132990 133050 133110 133170 137536 137542 137713 137737 137824 137830 Columns 331 through 345 137965 137989 138005 138065 138125 138185 141856 141862 142033 142057 142144 142150 142285 142309 142325 Columns 346 through 360 142385 142445 142505 146200 146206 146344 146350 146473 146497 146599 146623 146651 146681 146771 146801 Columns 361 through 375 155585 155610 155687 155748 155805 155866 155895 155956 156013 156074 156151 156176 160625 160650 160727 Columns 376 through 390 160788 160845 160906 160935 160996 161053 161114 161191 161216 163491 163493 163567 163568 163773 163797 Columns 391 through 405 163828 163830 163988 164034 164108 164154 170001 170151 170174 170324 170454 170604 170721 170871 170894 Columns 406 through 420 171044 171174 171324 172813 172819 172997 173021 173101 173107 173249 173273 173284 173344 173404 173464 Columns 421 through 435 177914 177938 177978 177984 178166 178190 178266 178272 178347 178407 178467 178527 181450 181452 181609 Columns 436 through 450 181610 181774 181798 181803 181805 181991 182029 182111 182149 190127 190265 190420 190522 190597 190687 Columns 451 through 465 190847 190985 191140 191242 191317 191407 192280 192430 192553 192703 192731 192881 195228 195330 195381 Columns 466 through 480 195519 195680 195770 197320 197470 197593 197743 197771 197921 200268 200370 200421 200559 200720 200810 Columns 481 through 495 203767 203768 203931 203933 204091 204115 204124 204126 204310 204353 204430 204473 208093 208099 208277 Columns 496 through 510 208301 208381 208387 208529 208553 208564 208624 208684 208744 215361 215511 215534 215684 215814 215964 Columns 511 through 525 216081 216231 216254 216404 216534 216684 217514 217538 217578 217584 217766 217790 217866 217872 217947 Columns 526 through 540 218007 218067 218127 221809 221810 221890 221892 222092 222116 222147 222149 222312 222351 222432 222471 Columns 541 through 555 230423 230620 230705 230848 230941 231001 231143 231340 231425 231568 231661 231721 233320 233470 233593 Columns 556 through 570 233743 233771 233921 235542 235581 235770 235863 236006 236066 238360 238510 238633 238783 238811 238961 Columns 571 through 585 240582 240621 240810 240903 241046 241106 243397 243403 243541 243547 243677 243701 243803 243827 243850 Columns 586 through 600 243880 243970 244000 247711 247712 247891 247915 247971 247973 248050 248052 248206 248267 248326 248387 Columns 601 through 615 252775 252776 252932 252956 252970 252972 253131 253133 253248 253305 253368 253425 257120 257144 257246 Columns 616 through 630 257270 257298 257304 257442 257448 257571 257601 257691 257721 265785 265887 265940 266078 266244 266334 Columns 631 through 645 266505 266607 266660 266798 266964 267054 270819 270860 271047 271142 271290 271350 271539 271580 271767 Columns 646 through 660 271862 272010 272070 275086 275224 275377 275479 275561 275651 275782 275977 276064 276205 276305 276365 Columns 661 through 675 280126 280264 280417 280519 280601 280691 280822 281017 281104 281245 281345 281405 282241 282389 282484 Columns 676 through 690 282691 282839 282934 282967 283133 283291 283324 283553 283630 287306 287406 287547 287756 287856 287997 Columns 691 through 705 289477 289627 289757 289907 289930 290080 292370 292452 292676 292707 292872 293031 295237 295387 295517 Columns 706 through 720 295667 295690 295840 301741 301767 301843 301905 301964 302027 302054 302117 302176 302238 ...