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

大牛们看看这个程序超时该怎么改改才可行

Posted by 3008216013 at 2010-04-04 22:02:17 on Problem 3175
#include<iostream>
#include<cmath>
using namespace std;
int main(void)
{
	double n,a,b,i(1);
	cin>>n>>a;
	double kk=pow(10.0,n);
	b=(a+1)/kk;
	a=a/kk;
	while(1)
	{
		if((int)pow(i+b,2)-(int)pow(i+a,2)>=1)
		{
			cout<<(int)pow(i+b,2)<<endl;
			break;
		}
		i++;
	}
	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