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

貌似该用long long

Posted by wywcgs at 2007-02-24 11:12:43 on Problem 2590
In Reply To:求大牛们点拨一下,翻阅过discuss所有主题,不知道为什么WA Posted by:MadDigerati at 2007-02-23 19:02:15
> #include<iostream>
> #include<cmath>
> using namespace std;
> int main()
> {
> 	int n,t,p;
> 	long a,b;
> 	float d;
> 	cin>>n;
> 	while(n>0)
> 	{
> 		cin>>a>>b;
> 		if(a==b) 
> 		{
> 			p=0;
> 		}
> 		else
> 		{
> 			d=sqrt(4.0*(b-a));
> 			t=(int)d;
> 			if(t<d) p=t;
> 			else p=t-1;			
> 		}
> 		cout<<p<<endl;
> 		n--;
> 	}
> 	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