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

Re:贴个代码:

Posted by 405040574 at 2010-01-01 13:51:50 on Problem 2853
In Reply To:贴个代码: Posted by:0810311106 at 2009-10-09 20:12:53
> #include"iostream"
> using namespace std;
> int main()
> {
> 	int n;
> 	cin>>n;
> 	while(n--)
> 	{
> 		long  sum;
> 		int num,t=0;
> 		int i;
> 		cin>>num>>sum;
> 		for(i=2;i<70000;i++)
>              if((2*sum-i*i+i)%(2*i)==0&&(2*sum-i*i+i)>0)
> 				 t++;
> 			 else if(2*sum-i*i+i<=0)
> 				 break;
> 		cout<<num<<" "<<t<<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