Search found 13 matches

by edmanm
Thu Feb 28, 2002 7:29 am
Forum: Volume 4 (400-499)
Topic: 458 - The Decoder
Replies: 71
Views: 14907

That was all I had to change! I was under the impression that the key could be something other than 7, but I was wrong.

Thank you much pochmann!!
by edmanm
Thu Feb 28, 2002 6:26 am
Forum: Volume 4 (400-499)
Topic: 458 - The Decoder
Replies: 71
Views: 14907

Here's my code so far. Am I on the right track?: #include <stdio.h> #include <string.h> #include <fcntl.h> #include <ctype.h> main() { char coded[3000]; char decoded[3000]; int length, i; int key; gets(coded); key = coded[0] - '*'; do { length = strlen(coded); for(i=0;i<length;i++) decoded = coded -...
by edmanm
Wed Feb 27, 2002 9:03 am
Forum: Volume 4 (400-499)
Topic: 458 - The Decoder
Replies: 71
Views: 14907

Can anybody give me some sample input to use to test my program for #458? My program works with the sample input given on the website, but I still get a W.A. What's the tricky input on this one??
by edmanm
Wed Feb 27, 2002 8:29 am
Forum: Volume 4 (400-499)
Topic: 495 - Fibonacci Freeze
Replies: 222
Views: 30257

495 - Fibonacci Freeze

I'm looking for any tips on #495. Clearly, the 5000th Fibonacci number is going to be huge, so what data type can store that number? Any tricks to calculating it quickly? Any help would be appreciated.
by edmanm
Sun Feb 10, 2002 8:20 am
Forum: Volume 5 (500-599)
Topic: 530 - Binomial Showdown
Replies: 137
Views: 33271

I got it! Yay! I just had to change my data type for storing the intermediate results from a long double to just a double. Thanks everybody for your help.
by edmanm
Sun Feb 10, 2002 3:53 am
Forum: Volume 5 (500-599)
Topic: 530 - Binomial Showdown
Replies: 137
Views: 33271

You're right, I hadn't considered that! That'll teach me to read the problem more carefully. So, I fixed it to terminate when a 0 is read for num1 && num2. Unfortunately, I still get a Wrong Answer.

P.S. Thanks Adrian for helping me on this one.
by edmanm
Sun Feb 10, 2002 1:57 am
Forum: Volume 5 (500-599)
Topic: 530 - Binomial Showdown
Replies: 137
Views: 33271

When testing my program using sample input, I get correct answers. Yet, when I submit my program, it says I have a wrong answer. What are the tricky inputs? I've tried using sample inputs of num1 = 2^31 and num2 = 2^31, and num1 = 2^31 and num2 = 1, which seem to be about the two limits since the an...
by edmanm
Sun Feb 10, 2002 12:02 am
Forum: Volume 5 (500-599)
Topic: 530 - Binomial Showdown
Replies: 137
Views: 33271

Thanks Adrian! Your line of code took care of my runtime error problem. But now I got a wrong answer. I think perhaps I'm using the wrong data type.

Any clues as to what the tricky input the judges uses?
by edmanm
Sat Feb 09, 2002 11:22 am
Forum: Volume 5 (500-599)
Topic: 530 - Binomial Showdown
Replies: 137
Views: 33271

Perhaps using Pascal's Triangle would be a better way to approach this problem????
by edmanm
Sat Feb 09, 2002 11:20 am
Forum: Volume 5 (500-599)
Topic: 530 - Binomial Showdown
Replies: 137
Views: 33271

Here is the code I submitted. It gives me the right answers to the sample input on my computer, but I get Time Limit Exceeded when I submit it for judging. Any input would be appreciated: #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <stdio.h> main() { int num1, num2, i; l...
by edmanm
Sat Feb 09, 2002 8:17 am
Forum: Volume 5 (500-599)
Topic: 530 - Binomial Showdown
Replies: 137
Views: 33271

530 - Binomial Showdown

Can anybody offer any hints to solving problem #530 - Binomial Showdown? My first attempt at solving this problem resulted in an exceeded time limit. Any tips?
by edmanm
Sat Feb 09, 2002 4:10 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 181736

Just got accepted! Thanks for reading.
by edmanm
Sat Feb 09, 2002 1:14 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 181736

100 - Help submitting my first problem...

Okay, I started off on problem 100 and thought I had it solved pretty quickly. Using the sample input given on the problem page, I ran the program on my machine and it arrived at the same output listed in the Sample Output. Unfortunately, when I submitted it, the judge says I have a "wrong answer". ...

Go to advanced search