F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

View Compilation Error

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");        }    }           
                                                                                                                                                                                                                                                                                                                                                                                                                                                                             ^


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-26 08:06:11, Gzip enabled