ok i understand the algo but not working through it correctly
given n = 3 and m = 5
k would be 2, so first move 2 rings to b.
now m = 2
k = 1
1 rings from b to c.
m = 1
that yeilds 1 ring on each pole which is correct, but seem to have a move left... what did i do wrong?
Search found 10 matches
- Fri Jul 26, 2002 8:28 pm
- Forum: Volume 2 (200-299)
- Topic: 254 - Towers of Hanoi
- Replies: 39
- Views: 20554
- Fri Jul 26, 2002 4:59 pm
- Forum: Volume 102 (10200-10299)
- Topic: 10200 - Prime Time
- Replies: 202
- Views: 96691
- Fri Jul 26, 2002 1:24 pm
- Forum: Volume 2 (200-299)
- Topic: 254 - Towers of Hanoi
- Replies: 39
- Views: 20554
- Thu Jul 25, 2002 9:20 pm
- Forum: Volume 2 (200-299)
- Topic: 254 - Towers of Hanoi
- Replies: 39
- Views: 20554
- Wed Jul 24, 2002 7:17 pm
- Forum: Volume 1 (100-199)
- Topic: 195 - Anagram
- Replies: 242
- Views: 58124
yes I am using windows. I guess i missread the documentation. it is usually pretty good at telling me when something is not standard. Anyway i swtiched to the toupper and my compile errors are gone. Now I am timing out(seems to be a common problem for me lately).
Any idea what my code is messing ...
Any idea what my code is messing ...
- Wed Jul 24, 2002 4:36 pm
- Forum: Volume 1 (100-199)
- Topic: 195 - Anagram
- Replies: 242
- Views: 58124
ok I think I have finally figured this out. I wrote my own compare routine for the sort algorithm to call. the program compiles on my system (win 2k and vc++) but I get a few compile errors from the judge. here are the errors I am getting.
00973177_24.c: In function `bool bSorted(basic_string<char ...
00973177_24.c: In function `bool bSorted(basic_string<char ...
- Wed Jul 24, 2002 1:34 pm
- Forum: Volume 2 (200-299)
- Topic: 254 - Towers of Hanoi
- Replies: 39
- Views: 20554
- Wed Jul 24, 2002 1:22 pm
- Forum: Volume 2 (200-299)
- Topic: 254 - Towers of Hanoi
- Replies: 39
- Views: 20554
- Tue Jul 23, 2002 9:05 pm
- Forum: C++
- Topic: need help with cin and blank inputs
- Replies: 2
- Views: 2719
need help with cin and blank inputs
ok what seems to be tripping me up on a few of these contest is how to deal with a blank input such as a space or carraiage return. I am trying to use cin and can't seem to trap it.
I have tried
while(cin >> input)
but i loop forever.
I have tried
while(cin >> input)
but i loop forever.
- Tue Jul 23, 2002 2:46 pm
- Forum: Volume 2 (200-299)
- Topic: 254 - Towers of Hanoi
- Replies: 39
- Views: 20554
254 - Towers of Hanoi
So I have what appears to me to be a working solution to problem 254, but the judge seems to think otherwise 8). I have timed out. Not sure what my issue is, maybe i was given input that I did not account for. I could use a push in the right diretion. At least when I type valid data, the program ...