0_0_13802192_677.cpp: In function 'void recur(int, int, int)':
0_0_13802192_677.cpp:4:11: error: a function-definition is not allowed here before '{' token
int main(){ int cas,max,i,len,last; scanf("%d",&cas); while(cas--) { scanf("%d",&n); s=0;max=0;sum[0]=0; for(i=1;i<=n;i++) {scanf("%d",&da[i]);s+=da[i];if(da[i]>max) max=da[i];used[i]=false;} if(s%4) {printf("no\n");continue;} s/=4; if(max>s) {printf("no\n");continue;} sort(da+1,da+n+1); for(i=1;i<=n;i++) sum[i]=sum[i-1]+da[i]; len=da[n];last=n-1;flag=0; recur(1,len,last); if(flag) printf("yes\n"); else printf("no\n"); } }
^
0_0_13802192_677.cpp:4:461: error: expected '}' at end of input
int main(){ int cas,max,i,len,last; scanf("%d",&cas); while(cas--) { scanf("%d",&n); s=0;max=0;sum[0]=0; for(i=1;i<=n;i++) {scanf("%d",&da[i]);s+=da[i];if(da[i]>max) max=da[i];used[i]=false;} if(s%4) {printf("no\n");continue;} s/=4; if(max>s) {printf("no\n");continue;} sort(da+1,da+n+1); for(i=1;i<=n;i++) sum[i]=sum[i-1]+da[i]; len=da[n];last=n-1;flag=0; recur(1,len,last); if(flag) printf("yes\n"); else printf("no\n"); } }
^
|