10444 - Multi-peg Towers of Hanoi
Moderator: Board moderators
10444 - Multi-peg Towers of Hanoi
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..
"Everything should be made simple, but not always simpler"
-
- Experienced poster
- Posts: 146
- Joined: Sat Apr 26, 2003 2:51 am
-
- Experienced poster
- Posts: 146
- Joined: Sat Apr 26, 2003 2:51 am
10444 - Multi-peg Tower of Hanoi - WA
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!
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!
I don't think there is tricky input other than n = 0, just some simple in/out here:
in:
out:
in:
Code: Select all
0 4
0 20
1 4
1 20
100 10
100 20
200 4
200 20
0 0
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
My signature:
- Please make discussion about the algorithm BRFORE posting source code.
We can learn much more in discussion than reading source code. - I HATE testing account.
- Don't send me source code for debug.
-
- New poster
- Posts: 1
- Joined: Thu Aug 18, 2005 8:34 pm
hi
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
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