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 |
用GCC提交2015MS 44K 用C提交578MS 28K。。。WHY? #include<stdio.h> void main() { int n,flag,i,j,k; long a[1002],b[1002],s; while( scanf("%d",&n)!=EOF){ if(n==0) break; flag=1; for(i=1;i<=n;i++) scanf("%ld",&a[i]); for(i=1;i<n;i++) b[i]=a[i+1]-a[i]; for(j=2;j<=n;j++){ for(i=1;i<=n;i++) scanf("%ld",&a[i]); for(i=1;i<n;i++) if(b[i]!=a[i+1]-a[i]){ flag=0; goto mm; } } mm: { for(k=j+1;k<=n;k++) for(i=1;i<=n;i++) scanf("%ld",&s); } if(flag==1) printf("homogeneous\n"); if(flag==0) printf("not homogeneous\n"); } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator