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

跟2853一样的,建议做了这道火速做2853,复制改改输入就OK了

Posted by TSERROF at 2012-08-18 15:27:17 on Problem 2140
#include <cstdio>
int main()
{
	int number;
	while(scanf("%d",&number)!=EOF)
	{
		int ans=0,sum=0;
		for(int i=1;(i+2)*(i+1)<=2*number;++i)
		{
			sum+=i;
			if((number-sum)%(i+1)==0)++ans;
		}
		printf("%d\n",ans+1);
	}
	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