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

高手来帮我看看这段AC了的代码啊,我交了两次,一次0ms,一次15ms,这是怎么回事啊?

Posted by simbaforrest at 2007-05-04 11:51:07 on Problem 2140
我交了两次,一模一样的代码,一次0ms,一次15ms,这是怎么回事啊?

#include<stdio.h>
int main()
{int cnt=0,i;long s;
  scanf("%ld",&s);
  for(i=1;s>=(i+1)*i/2;i++)
     if((s-(i-1)*i/2)%i==0)cnt++;
  printf("%d",cnt);    
}

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