Problem 2650. Kurchan 4x4 - Optimal score
Related to Problem 1646, but bigger. Technically, all you need to do for this Cody problem is input a 4x4 matrix containing the numbers 1-16. However, your score will be the Kurchan value of the matrix, which is defined as the difference between the maximum and minimum of the products for the rows, columns, diagonals, and anti-diagonals of the matrix.
For example: Magic(4) is
16 2 3 13 5 11 10 8 9 7 6 12 4 14 15 1
The row products are:
- 16*2*3*13=1248
- 5*11*10*8=4400
- 9*7*6*12=4536
- 4*14*15*1=840
The column products are:
- 16*9*5*4=2880
- 2*11*7*14=2156
- 3*10*6*15=2700
- 13*8*12*1=1248
The diagonal products are:
- 16*11*6*1=1056
- 2*10*12*4=960
- 3*8*9*14=3024
- 13*5*7*15=6825
The anti-diagonal products are:
- 13*10*7*4=3640
- 3*11*9*1=297
- 2*5*12*15=1800
- 16*8*6*14=10752
The highest value is 10752, while the lowest is 297. Therefore, the score of this matrix is 10455. Your Cody score will be the Kurchan score of your matrix.
Solution Stats
Problem Comments
-
2 Comments
And do we seek to obtain a higher or lower score? what is the goal?
I went for the minimum score that I was able to find at least, and
found 3724. Moreover, I submitted the algorithm and the hardcoded solution.
Solution Comments
Show commentsGroup

Combinatorics III
- 22 Problems
- 12 Finishers
- What can you get for exactly amount of money(harder)
- Highest powers in factorials
- Exponents in Factorials
- Kurchan Square - Evaluation Function
- Kurchan 3x3 - Optimal Score
- Kurchan 4x4 - Optimal score
- Kurchan 5x5 - Optimal Score
- Factorial: Unlimited Size : java.math
- Lowest sum from a group of digits
- Create all combinations of vectors
- Full combinations
- So many choices
- Factorizing a number into a given number of factors
- Addition Partition
- Find the inverse permutation
- Red and green towers
- Maximum sum from any 2 numbers with a variable number of inputs
- Sleeping Queens 1
- Recycled Numbers (CodeJam Qualification Round 2012)
- Sum of combinations
- Penny Flipping: Reverse subsets of a sequence of coins until you recover the original configuration
- Penny Distribution Machine
Problem Recent Solvers37
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!