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 |
急急急急。。。高手指点:为什么我这个程序总是Output limit Exceeded?#include<stdio.h> int main() { int n,*p,i,j,temp,sum,b; int q[25]; while(scanf("%d",&n)&&n<=20){ sum=0; p=new int[n]; for(i=0;i<n;i++) {scanf("%d",&b);if(b>10000000) return 0;p[i]=b;} for(j=0;j<n;j++) { if(j==0){ for(i=0;i<25;i++) { q[i]=p[j]%2; p[j]/=2; } } else{ for(i=0;i<25;i++) { temp=q[i]; q[i]=p[j]%2; q[i]=temp^q[i]; p[j]/=2; } } } for(i=0;i<25;i++) if(q[i]==1) {sum=1;goto success;} success: if(sum==0&&n!=1) printf("No \n"); else printf("Yes \n"); } return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator