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 |
why I Presentation Error(with the source)#include<stdio.h> int main() { int arry[60],t,n,i,a[30],k,j; scanf("%d",&t); while(t--) { scanf("%d",&n); a[0]=0;k=0; for(i=1;i<=n;i++) { scanf("%d",&a[i]); for(j=k+1;j<=k+a[i]-a[i-1];j++) arry[j]=1; k=j; arry[k]=0; } for(i=1;i<=n;i++) a[i]=0; k=0; for(i=1;i<=2*n;i++) { if(arry[i]==1) { k++; for(j=1;j<=k;j++) a[j]++; } else if(arry[i]==0) { if(k==1) printf("%d\n",a[k]); else printf("%d ",a[k]); a[k]=0; k--; } } } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator