Page 1 of 14
103 - Stacking Boxes
Posted: Mon Apr 08, 2002 4:34 am
by --X--
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
Posted: Tue Apr 09, 2002 3:34 am
by FireDragon
Your algorithm is the same as mine----1)Sort the boxes' dimensions 2)Get the longest path.And My solution was accepted two days ago.
Goodluck.
It may be helpful
Posted: Wed Apr 10, 2002 7:05 pm
by chang
It was my mistake:when the maximum no of box is 1... I printed 0 wronlgly...
Did u check this input....
Posted: Sat Apr 13, 2002 8:34 am
by hsihsiwu
If input is 6 1, what is answer?
Posted: Sun Apr 14, 2002 3:54 pm
by C8H10N4O2
If input is
Output should be
Posted: Tue Apr 16, 2002 11:29 pm
by hsihsiwu
Thanks. I got it.
103 - Why does it time out?
Posted: Fri May 24, 2002 4:39 am
by ositruc
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 online-judge times out. Does anyone have any idea what input they are using that could time out my program?
103 yellow check mark???
Posted: Wed May 29, 2002 3:42 am
by amadeus082
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
Posted: Wed May 29, 2002 9:37 am
by ftomi
The yellow colour means a special correction program for that problem. It's because there are more solution.
Question on 103
Posted: Fri May 31, 2002 6:38 pm
by Melon Melon
[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!
Posted: Fri May 31, 2002 6:47 pm
by cyfra
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 one-way 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..
Thanks a lot!!! ^^
Posted: Fri May 31, 2002 6:57 pm
by Melon Melon
Ths!!Ths!!
...
Posted: Thu Jun 20, 2002 1:21 pm
by obayashi
maybe u use brute force to search for the result.
post yr code here pls...
103 DP
Posted: Thu Jun 20, 2002 2:14 pm
by Revenger
You must use DP or DFS to solve this problem. If realy want help then post your source code.
Posted: Mon Jun 24, 2002 7:35 pm
by dawynn
Does anyone have any suggestions on tricky cases to try?