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 simbaforrest at 2007-05-25 22:33:39 on Problem 2853
In Reply To:Re:用笨办法太慢了,高手能指点指点吗? Posted by:414549269 at 2007-02-09 21:58:28
没太看懂,我自己作了一个,好像还行。。。
  scanf("%d%ld",&id,&s);
  for(i=1;s>=(i+1)*i/2;i++)
     if((s-(i-1)*i/2)%i==0)cnt++;
  printf("%d %d\n",id,cnt-1);



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