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:高手来帮我看看这段AC了的代码啊,我交了两次,一次0ms,一次15ms,这是怎么回事啊?

Posted by fbixiaozc135 at 2007-07-24 16:55:40 on Problem 2140
In Reply To:高手来帮我看看这段AC了的代码啊,我交了两次,一次0ms,一次15ms,这是怎么回事啊? Posted by:simbaforrest at 2007-05-04 11:51:07
我的也是,马甲是0ms,自己过就是15MS了~
#include <iostream>
#include <cmath>
using namespace std;
void main()
{
	int m,temp;
	cin>>m;
	int max=(sqrt(8*m+1)+1)/2;
	int count=1;
	for(int i=2;i<max;i+=2)
	{
                  temp=m;
		temp/=i;
		if((2*temp+1)*(i/2)==m)
			count++;
	}
	for(i=3;i<max;i+=2)
	{
		temp=m;
		temp/=i;
		if(temp*i==m)
			count++;
	}

		cout<<count<<endl;
}
		

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