10775 - Mystical Matrix

All about problems in Volume 107. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Post Reply
Dmytro Korzhyk
New poster
Posts: 8
Joined: Sat Dec 20, 2003 12:57 pm
Location: Duke University, NC

10775 - Mystical Matrix

Post by Dmytro Korzhyk »

Can anyone explain an idea how to solve this problem?
..
A great helper
Posts: 454
Joined: Thu Oct 18, 2001 2:00 am
Location: Hong Kong

Post by .. »

You better first find out the answer of N=9,
it can help you to observe some property of the required matrix.
My signature:
  • Please make discussion about the algorithm BRFORE posting source code.
    We can learn much more in discussion than reading source code.
  • I HATE testing account.
  • Don't send me source code for debug.
bugzpodder
Experienced poster
Posts: 147
Joined: Fri Jun 13, 2003 10:46 pm

Post by bugzpodder »

my solution is based on that of the magic square... but i am curious as to the others' approaches since there are possibly literally zillions of ways to generates these monsters :)
Cho
A great helper
Posts: 274
Joined: Wed Oct 20, 2004 11:51 pm
Location: Hong Kong

Post by Cho »

.. wrote:You better first find out the answer of N=9,
it can help you to observe some property of the required matrix.
I know the anwer for N=9 but it doesn't help me to solve the problem.
Base on the solution for N=3, I can generate all solutions for N=3^n. I tried this method but got WA.
..
A great helper
Posts: 454
Joined: Thu Oct 18, 2001 2:00 am
Location: Hong Kong

Post by .. »

Code: Select all

N = 3
1 6 8
5 7 3
9 2 4

N = 9
 1  2  3| 16 17 18| 22 23 24
--------+---------+---------
14 15 13| 20 21 19|  8  9  7
--------+---------+---------
27 25 26|  6  4  5| 12 10 11
I find that, if I divide the matrix of N = 9 into 9 parts of 3 numbers, each part will corresponsde to a number in the matrix of N = 3. Because the maximum number in each part is a multiple of the corresponding number in N = 3.

The remaining problem is how to allocate the numbers in each part.
I stop at here to keep the interest of solving this problem :)
My signature:
  • Please make discussion about the algorithm BRFORE posting source code.
    We can learn much more in discussion than reading source code.
  • I HATE testing account.
  • Don't send me source code for debug.
Dmytro Korzhyk
New poster
Posts: 8
Joined: Sat Dec 20, 2003 12:57 pm
Location: Duke University, NC

Post by Dmytro Korzhyk »

Thank you, I've got AC :)
Eduard
Experienced poster
Posts: 183
Joined: Fri Sep 26, 2003 2:54 pm
Location: Armenia,Yerevan

Post by Eduard »

Please someone give me answer for N=12.
Thanks
someone who like to solve informatic problems.
http://acm.uva.es/cgi-bin/OnlineJudge?AuthorInfo:29650
..
A great helper
Posts: 454
Joined: Thu Oct 18, 2001 2:00 am
Location: Hong Kong

Post by .. »

Eduard wrote:Please someone give me answer for N=12.
Thanks
.............You better first calculate the column sum for N = 12
My signature:
  • Please make discussion about the algorithm BRFORE posting source code.
    We can learn much more in discussion than reading source code.
  • I HATE testing account.
  • Don't send me source code for debug.
Eduard
Experienced poster
Posts: 183
Joined: Fri Sep 26, 2003 2:54 pm
Location: Armenia,Yerevan

Post by Eduard »

Yes,I see it. :lol:
someone who like to solve informatic problems.
http://acm.uva.es/cgi-bin/OnlineJudge?AuthorInfo:29650
Cho
A great helper
Posts: 274
Joined: Wed Oct 20, 2004 11:51 pm
Location: Hong Kong

Post by Cho »

Is it solvable for some N where N is not 3^n?
Is it solvable for N=15?
..
A great helper
Posts: 454
Joined: Thu Oct 18, 2001 2:00 am
Location: Hong Kong

Post by .. »

Cho wrote:Is it solvable for some N where N is not 3^n?
Yes
Cho wrote:Is it solvable for N=15?
Yes

You can try to construct the matrix for N = 15 with my hint given before.
My signature:
  • Please make discussion about the algorithm BRFORE posting source code.
    We can learn much more in discussion than reading source code.
  • I HATE testing account.
  • Don't send me source code for debug.
Cho
A great helper
Posts: 274
Joined: Wed Oct 20, 2004 11:51 pm
Location: Hong Kong

Post by Cho »

I got it, thx a lot.
sjn
Learning poster
Posts: 73
Joined: Mon Apr 08, 2002 8:22 am
Contact:

Post by sjn »

what about N=5?
Post Reply

Return to “Volume 107 (10700-10799)”