## 11033 - Help my Brother

Moderator: Board moderators

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

### 11033 - Help my Brother

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
i am getting TLE. complexity of my algorithm is 7 ^ 9. is that ok? can it be done in better time? please help someone

mf
Guru
Posts: 1244
Joined: Mon Feb 28, 2005 4:51 am
Location: Zürich, Switzerland
Contact:
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
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
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