Page 1 of 1

10444 - Multi-peg Towers of Hanoi

Posted: Mon Sep 08, 2003 4:45 pm
by anupam

Hello,
I have tried to solve the problem in all the ways but got wa in 0:004s.
What may be the problem??
My method is first to choose the bound (lower and upper) of n1, where n1 is the disks taken from n disks to intermidiate pegs. and then solve the problem by D and C method(Divide and Con.).
Please discuss abt the common errors for this prticular problem. I used POS system.(Optimal and Greedy).
My question is:
When I got the inequility, what should i do??
I have taken the least value of n1 from the inequility.
Should I choose the mean value of the ineuility or should i choose the upper bound??
I saw it has no special judge problem.
So what abt the cases when I have several n1 to choose, can it give different value for each n1??
Thabk for help.
If you can't understand, I will put my src here..

Posted: Tue Sep 09, 2003 1:46 am
by Dmytro Chernysh
Do you need input/output? I can give you...
Mail me...

Posted: Thu Sep 11, 2003 11:50 am
by anupam
ok. i have solved it by dp.
but i face problem to print all the moves.
plz help.
--
anupam

Posted: Thu Sep 11, 2003 2:23 pm
by anupam

ok now but tle.
plz help

Posted: Thu Sep 11, 2003 6:57 pm
by Dmytro Chernysh
Solve the problem only once!!! At the begining save the answer in a table [200,20].

Posted: Fri Sep 12, 2003 7:23 am
by anupam

Do you mean precalculation??

Posted: Fri Sep 12, 2003 8:06 am
by anupam

thank you. got ac by precalculation

10444 - Multi-peg Tower of Hanoi - WA

Posted: Sat Nov 27, 2004 5:03 pm
by ulin
Hi!
I use dp and I have no idea, why it get WA. (where it could be mistake in my program)
Maybe some tricky inputs?
Please, give me some tests.

Best Regards!

Posted: Sun Nov 28, 2004 7:08 pm
by ..
have you considered n = 0?

Posted: Sun Nov 28, 2004 7:16 pm
by ulin
Yes!
For n=0 I print 0

Posted: Sun Nov 28, 2004 7:25 pm
by ..
I don't think there is tricky input other than n = 0, just some simple in/out here:

in:

Code: Select all

0 4
0 20
1 4
1 20
100 10
100 20
200 4
200 20
0 0
out:

Code: Select all

Case 1: 0
Case 2: 0
Case 3: 1
Case 4: 1
Case 5: 601
Case 6: 361
Case 7: 14680065
Case 8: 801

hi

Posted: Thu Aug 18, 2005 8:37 pm
by iluvmylife
hi ppl!!!

can neone send me the source code (preferably C) for the multipeg tower of hanoi prob, plzzzzzzzzzzz...

plz send it to undercover_sherlock@yahoo.com

plz...
thnx