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:各位高手帮忙看看啊。不胜感谢....怎么总说超时了啊??In Reply To:各位高手帮忙看看啊。不胜感谢....怎么总说超时了啊?? Posted by:qichao at 2009-07-20 21:08:11 > #include<stdio.h> > > int main() > { > int i,j,t,a[14],k; > unsigned long int n; > scanf("%d",&k); > while(k!=0) > { > for(n=k;1;n++) > { > for(i=0;i<2*k;i++) > a[i]=i+1; > for(i=2*k,t=0;i>k;i--) > { > t=(t+n-1)%i; > if(a[t]<=k) > break; > for(j=t;j<i-1;j++) > a[j]=a[j+1]; > } > if(i<=k) > { > printf("%d\n",n); > break; > } > } > scanf("%d",&k); > } > } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator