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

请教大牛,为什么我这个算法是WA呢!!!!!!!!!!

Posted by 200740442 at 2009-10-06 21:33:06 on Problem 2140
#include<iostream>
using namespace std;
int main()
{
	int num;
	int cnt = 0;
	cin >> num;
	num *= 2;
	int tmp = num;
	for(int i=1;i<=num;i++)
	{
		num = tmp;
		if(num%i==0)
		{
			num /=i;
			num = num + 1 - i;
			if(num>0 && num%2==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