ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1483. Table Football

I 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.
exwRabbits_AlMag(VNTU) Re: The algo is easy, but the idea is not quite...(-) [4] // Problem 1483. Table Football 17 Oct 2006 13:50
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.
Nikolay Makarov Idea is very easy for this problem! [2] // Problem 1483. Table Football 11 Mar 2007 03:40
First number is always : (n - 1).
Second if n even => 3 * ((n - 2) / 2) + 1
If n odd => 3 * ((n - 1) / 2)
Tural Neymanov Yes, idea is realy very easy! // Problem 1483. Table Football 11 Jan 2008 22:16
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