Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Re:高手来帮我看看这段AC了的代码啊,我交了两次,一次0ms,一次15ms,这是怎么回事啊?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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator