Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

这个算法居然用了快1000MS?想不通哦。

Posted by queyue2004 at 2005-06-06 16:13:11 on Problem 2368
#include <stdio.h>
#include <iostream.h>
#include <math.h>

main (void)
{
	long number,i;

	scanf ("%d",&number);

	for (i = 3;i <= number;i++)
	{
		if (number % i == 0)
		{
			break;
		}
	}
	cout << i - 1 << endl;

	return 0;
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator