Page 1 of 1

11033 - Help my Brother

Posted: Tue May 16, 2006 8:12 pm
by C
I need some more I/O. PLZ Help.
And I used a ugly method and got WA at about 2 CPU time, which already exceeded the contest time constraints. Any hint I will also be appreciate.

Thanks.

Posted: Tue May 16, 2006 10:28 pm
by fpavetic
i am getting TLE. complexity of my algorithm is 7 ^ 9. is that ok? can it be done in better time? please help someone :roll:

Posted: Tue May 16, 2006 10:56 pm
by mf
fpavetic wrote:i am getting TLE. complexity of my algorithm is 7 ^ 9. is that ok?
Yeah, I've got accepted with 9 nested loops -- 0.764 sec.

Posted: Tue May 16, 2006 11:01 pm
by C
Why 9 nested loop, I used only 7 nested loop, and other 9 numbers can be calculated from the 7 numbers. But I got WA, I don't know why.
Can someone help me ???

Posted: Tue May 16, 2006 11:22 pm
by fpavetic
then i dont understand why tle

here is my code

there are 9 nested loops: i fill first three columns in first three rows
and the forth column i get subtracting first three from n: the same for forth row

example
board[0][0], board[0][1], board[0][2] - loop
board[0][3] = n - board[0][0] - board[0][1] - board[0][2]

Code: Select all

ACC, comlexity 7^8, can it be done better?
where is my problem :-?

Posted: Wed May 17, 2006 6:54 pm
by Jan
Try to find a 7^7 solution. Its not so hard. Just some math. :D I can assure u that there exists a 7^7 solution.