| ||||||||||
| 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 | |||||||||
为什么我这么做就老是超时?#include<math.h>
main()
{
int sum,n;
scanf("\n%d",&sum);
for(n=(int)sqrt((float)2*sum)+1;!((n*(n+1)>2*sum)&&(n*(n+1)/2-sum)%2==0);n++)
{
;
}
printf("\n%d",n);
getch();
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator