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 wx1166750 at 2006-08-06 01:57:20 on Problem 2140
#include<iostream>
using namespace std;

int main()
{
	int n,i,count;
	cin>>n;
	for(i=2,count=0;n/i-(i-1)/2>0;i++)
	{
		if(i%2==0)
		{
			if((n/i+n/i+1)*i/2==n)
				count++;
		}
		else
		{
			if(n%i==0)
				count++;
		}
	}
	cout<<count+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