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 songruirui at 2013-04-29 08:40:24 on Problem 2140
In Reply To:公式的推导 Posted by:Ly86 at 2010-04-25 19:03:36
推导有一点点问题,应该是(a+0.5*k)(k+1)=n推出(2*a+k)(k+1)=2n,这个式子左边的两个因子1奇1偶,但是不确定,等价于求2*n的奇因子或偶因子的个数,而2*n的奇因子个数等于n的奇因子个数,因此最后结论还是求n的奇因子个数
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
	long long n;
	cin>>n;
	int cnt=0;
	for(int i=1;i<=n;i=i+2)
	{
		if(n%i==0)
			cnt++;

	}
	cout<<cnt<<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