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 |
TLE了,这样做为什么会TLE!??#include<math.h> #include<stdio.h> main(){ int n,temp=1,h,j; int i,k,sum=1; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&k); sum=k+1; for(j=2;j<=(k/2+1);j++){ for(h=k-pow(2,j-1);h!=0;h--){ temp=temp*h; } sum=temp+sum; temp=1; } printf("Scenario #%d:\n%d\n",i+1,sum); sum=0; } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator