Search found 5 matches

by goinglee
Thu May 07, 2009 3:26 am
Forum: Volume 5 (500-599)
Topic: 583 - Prime Factors
Replies: 171
Views: 61390

Re: 583 - Prime Factors

Yeah, I've solved this problem by just fixing double to int....Thank you very much!! :D :D
by goinglee
Wed May 06, 2009 7:38 am
Forum: Volume 5 (500-599)
Topic: 583 - Prime Factors
Replies: 171
Views: 61390

Re: 583 - Prime Factors

Why are you using floating-point numbers? They're very slow and totally unnecessary here.

And for this you should've got runtime error:
freopen("583.in","r",stdin);
Ever heard of standard input/output redirection?

Since the problem depicts that the range of the input g is -2^31 ~ 2^31, I think ...
by goinglee
Tue May 05, 2009 11:43 am
Forum: Volume 5 (500-599)
Topic: 583 - Prime Factors
Replies: 171
Views: 61390

Why Time Limit Exceed

I've tested all the test case and all the outputs all correct, but I can not understand why I always got Time Limit Exceed....Could someone give me a great help please?? Thanks a lot!!!!! :cry:

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

void Calculate_Prime(double input, long int ...
by goinglee
Wed Apr 08, 2009 2:49 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 318536

Re: 100

mf wrote:Don't ever use feof.
Check the return value of scanf instead.
I've got the right answer!!! The reason why I got failed is that I did not check the return value of scanf. Anyway, thank you very much. :D :D :D
by goinglee
Tue Apr 07, 2009 7:43 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 318536

Re: 100 Could someone help me?

I do not know why my code is always WA when submission, could someoen help me, please?Thanks. :(
Below is my code:

#include <stdio.h>
#include <stdlib.h>
#define isInRange(x) (x>0 && x <1000000)
int process_problem(long input)
{
int number = 0;
while(input!=1)
{
number++;
if((input%2)==1 ...

Go to advanced search