Search found 5 matches

by Red Cent
Mon Jan 23, 2006 12:31 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 187970

duh

I forgot I changed the loop from counter != second number to counter <=secondnumber

making the bigger number entered first not work!

Oops

Thanks.
by Red Cent
Sun Jan 22, 2006 10:48 pm
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 187970

Wow - I bow to those who solved this deceivingly simple prob

Okay. I narrowed down what my program was doing. Geez. It's a simple problem that's cursed website owners and commercial enterprises. I found a test case number (by putting in ranges of test inputs) which I wont reveal here, unless asked of course, that when I put in that number as input, my program...
by Red Cent
Sun Jan 22, 2006 10:01 pm
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 187970

laughing all the way...

Okay.

Now it compiles (because I forgot that stupid return statement)

Now it reports TIME LIMIT EXCEEDED.

Is my program that inefficient?
by Red Cent
Sun Jan 22, 2006 9:57 pm
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 187970

ugh

oh ...


like DUH...

Lets see if that works then.
by Red Cent
Sun Jan 22, 2006 9:28 pm
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 187970

CE with problem 100 3N+1

Im getting discouraged here. I know the algorithm. Ive compiled successfully on linux with gcc using the -ansi flag. But yet Im getting the CE problem. Here is the code: /* 3N+1 */ #include <stdio.h> #include <stdlib.h> int cycles(long); int main (int argc, char **argv) { int result = 1; long i=1; i...

Go to advanced search