|
|
back to boardI have Ac(0.015) by diagonal sequantal placing nambers 1..N*N from max and min alternating 25 2 22 6 2 17 1 23 5 18 10 24 4 19 9 14 3 20 8 15 12 21 7 16 11 13 but clear mathamatic proof i don't now and this is most interesting. I will try find out such proof and if people will have interest will send this proof to forum. Without proof algotithm hasn't hard foundation. So, what is your algo, svr? After building your matrix, what are you doing? Thanks. Edited by author 17.10.2006 13:53 If we have optimal matrix to take answer is very simple problem. We use double loop, calculate sums A[i,j]+A[i-1,j] and A[i,j-1]+A[i,j] and renew record value searching max. First number is always : (n - 1). Second if n even => 3 * ((n - 2) / 2) + 1 If n odd => 3 * ((n - 1) / 2) Yes, I have also maden by this way. My program is in 7 lines(without var,begin,end - 3). But I don'y understand why it works in 0.015, except 0.001. I used only 1 read and if. strange isn't it? what is answer if n=8 when only one match with win&lose ,and other is draw answer should be 6 9 (6(1)+3)? Edited by author 24.02.2008 13:21 Edited by author 24.02.2008 13:21 |
|
|