834 - Continued Fractions

All about problems in Volume 8. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

nymo
Experienced poster
Posts: 149
Joined: Sun Jun 01, 2003 8:58 am
Location: :)

numerator / denominator == a whole number ???

Post by nymo » Sat Oct 28, 2006 11:52 am

I get ACC even without considering the case when numerator / denominator is a whole number. My program crashes on this input. So, there may not be such a case.

User avatar
plamplam
Experienced poster
Posts: 150
Joined: Fri May 06, 2011 11:37 am

Re: 834 - Continued Fractions

Post by plamplam » Fri Jul 29, 2011 8:17 pm

I agree with nymo, I could modify my program to handle special cases where the numerator / denominator is a whole number but I decided to give it a shot first. AC in first try. My program would get Runtime Error if there were such cases. Very simple problem, you should get AC if the sample output matches as there are no special cases.
You tried your best and you failed miserably. The lesson is 'never try'. -Homer Simpson

User avatar
uDebug
A great helper
Posts: 475
Joined: Tue Jul 24, 2012 4:23 pm

Re: 834 - Continued Fractions

Post by uDebug » Mon Jul 14, 2014 12:31 pm

Timo wrote: I have create random sample input and output from my AC program.

Hope it help you.
These are some great test cases! Thanks for sharing.
Check input and AC output for over 7,500 problems on uDebug!

Find us on Facebook. Follow us on Twitter.

axelblaze
New poster
Posts: 34
Joined: Mon Jun 23, 2014 7:45 pm

Re: 834 - Continued Fractions

Post by axelblaze » Fri Oct 10, 2014 10:42 am

Don't know why getting TLE...! Tested all the inputs by timo...
here's my code... plz help... :cry:

Code: Select all

Got AC...
Last edited by axelblaze on Fri Oct 10, 2014 1:31 pm, edited 1 time in total.

lighted
Guru
Posts: 585
Joined: Wed Jun 11, 2014 9:56 pm
Location: Kyrgyzstan, Bishkek

Re: 834 - Continued Fractions

Post by lighted » Fri Oct 10, 2014 11:00 am

It is more safe to read this way.

Code: Select all

while (scanf("%d %d", &a, &b) == 2)
A person who sees the good in things has good thoughts. And he who has good thoughts receives pleasure from life... Bediuzzaman

axelblaze
New poster
Posts: 34
Joined: Mon Jun 23, 2014 7:45 pm

Re: 834 - Continued Fractions

Post by axelblaze » Fri Oct 10, 2014 1:30 pm

Thanks I got AC... :)

Post Reply

Return to “Volume 8 (800-899)”