103  Stacking Boxes
Moderator: Board moderators
103  Stacking Boxes
Does anyone have an insight into some trick the judges input may have. The problem is a straightforward longest path algorithm, which makes me wonder why I keep getting WA.
Thnx for any help
Thnx for any help

 New poster
 Posts: 4
 Joined: Fri Apr 05, 2002 2:00 am
 Location: HeBei,China
It may be helpful
It was my mistake:when the maximum no of box is 1... I printed 0 wronlgly...
Did u check this input....
Did u check this input....
If input is
Output should be
Code: Select all
6 1
Code: Select all
1
1
103  Why does it time out?
My program seems to work for any test case I give it, within the boundaries specified by the problem statement. However when I submit my code the onlinejudge times out. Does anyone have any idea what input they are using that could time out my program?
"Arrrrr! I'm a pirate!"
Pirate.
Pirate.

 New poster
 Posts: 1
 Joined: Wed May 29, 2002 3:34 am
 Contact:
103 yellow check mark???
What exactly does the yellow check mark mean next to the problem? Apparently it's affecting my program because it works for every test case I use, but got wrong answer from the judge. Does any know any special things in the input?
Matthew
Matthew

 New poster
 Posts: 17
 Joined: Fri May 31, 2002 6:30 pm
 Contact:
Question on 103
[c]
Would anyone give me hints on solving question 103??
I have that a silly way to do it, but don't know how to continue it or my way is wrong.
I first sort the dimensions of each box and then try to find out each boxes which can hold the next box......but if I do in this way, the codes will be very complicated.
Could anyone help me, please?[/c]
Would anyone give me hints on solving question 103??
I have that a silly way to do it, but don't know how to continue it or my way is wrong.
I first sort the dimensions of each box and then try to find out each boxes which can hold the next box......but if I do in this way, the codes will be very complicated.
Could anyone help me, please?[/c]
Hi!
Hi!
Yes of course you have good idea....
Just try to look at this problem as a graph...
( But you will not have to implement it )
so there is a line beetween two boxes if you can put one into another..
This graph is oneway graph and it has no cycles...
So now you have only to count the longest path in such a graph...
Which is quite easy...
So don't worry that your program will be very complicated..
It only has to work
Good Luck
PS.
Next time try not to use table for C code for normal writing..
Yes of course you have good idea....
Just try to look at this problem as a graph...
( But you will not have to implement it )
so there is a line beetween two boxes if you can put one into another..
This graph is oneway graph and it has no cycles...
So now you have only to count the longest path in such a graph...
Which is quite easy...
So don't worry that your program will be very complicated..
It only has to work
Good Luck
PS.
Next time try not to use table for C code for normal writing..

 New poster
 Posts: 17
 Joined: Fri May 31, 2002 6:30 pm
 Contact:
Thanks a lot!!! ^^
Ths!!Ths!!