my code is running perfectly well but giving WA in spoj.. #include<stdio.h> #include<stdlib.h>
int main() { int cand,sum; int T,N,i,j,temp[100000]; scanf("%d",&T); sum = 0; for(i=0;i<T;i++) { scanf("%d",&N); for(j=0;j<N;j++) { scanf("%d",&cand); sum = (sum+cand)%N; } if(sum == 0) temp[i]=1; else temp[i]=0; } for(i=0;i<T;i++) { if(temp[i]==1) printf("YES\n"); else printf("NO\n"); } return 0; } -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.