Search found 5 matches

by 23756AW
Tue Nov 12, 2002 1:02 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 193490

Brute force won't work on this. You need to employ some dynamic programming to solve this efficiently. That means you should create an array and store some already solved results. Then when update the ackerman function to do the ackfunct and then check the result to see if it is in the array. If it ...
by 23756AW
Tue Nov 12, 2002 12:58 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 193490

That C code cannot possibly represent the C++ solution that was accepted. There is not one shred of dynamic programming there which is a key component to solving this problem. That looks like the brute force method which doesn't work in C or C++. Can I see the C++ code you submitted?
by 23756AW
Mon Nov 11, 2002 2:32 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 193490

Per the above reply that is correct. Specify C++ in your header or get in the habit of using /* xxx */ comment style. I typically use the /* ... style in both this and work so that when I work on both C and C++ programs I don't run into that problem (this has happened where I work sometimes where ou...
by 23756AW
Mon Nov 11, 2002 2:24 am
Forum: Volume 4 (400-499)
Topic: 400 - Unix ls
Replies: 93
Views: 18379

400 - Solution with Full Documentation

[cpp] /* @JUDGE_ID: 23756AW 400 C++ "IO Manipulators and Sorted Vector" */ /* PROBLEM_ID: 400 SYNOPSIS: This program has two real traps. The first is that the last column in a row is equal the maximum filename length. All the other preceding columns in the row are equal to the maximum filename lengt...
by 23756AW
Mon Sep 30, 2002 1:02 am
Forum: Volume 1 (100-199)
Topic: 101 - The Blocks Problem
Replies: 635
Views: 45268

Friendly reminder

Don't forget that if the blocks ocurr in the same stack that you ignore that command.

Go to advanced search