11033 - Help my Brother

All about problems in Volume 110. 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
C
New poster
Posts: 35
Joined: Mon Apr 17, 2006 1:04 pm

11033 - Help my Brother

Post 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.

fpavetic
Learning poster
Posts: 51
Joined: Sat Mar 04, 2006 8:00 pm

Post 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:

mf
Guru
Posts: 1244
Joined: Mon Feb 28, 2005 4:51 am
Location: Zürich, Switzerland
Contact:

Post 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.

C
New poster
Posts: 35
Joined: Mon Apr 17, 2006 1:04 pm

Post 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 ???

fpavetic
Learning poster
Posts: 51
Joined: Sat Mar 04, 2006 8:00 pm

Post 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 :-?

Jan
Guru
Posts: 1334
Joined: Wed Jun 22, 2005 10:58 pm
Location: Dhaka, Bangladesh
Contact:

Post 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.
Ami ekhono shopno dekhi...
HomePage

Post Reply

Return to “Volume 110 (11000-11099)”