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_19230786_6878.cpp: In function 'int main()':
0_0_19230786_6878.cpp:12:37: error: 'n' was not declared in this scope
 int main(){    while(scanf("%d %d",&n,&m)!=EOF)    {        
                                     ^
0_0_19230786_6878.cpp:12:40: error: 'm' was not declared in this scope
 int main(){    while(scanf("%d %d",&n,&m)!=EOF)    {        
                                        ^
0_0_19230786_6878.cpp:11:13: error: '__int64int' was not declared in this scope
 #define i64 __int64int Max(int a,int b){return a>b?a:b;}int Min(int a,int b){return a<b?a:b;}int n,m; 
             ^
0_0_19230786_6878.cpp:14:27: note: in expansion of macro 'i64'
 int i,maxw,maxl,j;        i64 a_min,a_max,temp;        a_min=a_max=0;        maxw=maxl=0;        for(i=0;i<5555;i++)hash[i][0]=hash[i][1]=0;        for(i=0;i<n;i++)        {            scanf("%d",&temp);            maxw=Max(temp,maxw);            hash[temp][0]++;        }        for(i=0;i<m;i++)        {            scanf("%d",&temp);            maxl=Max(temp,maxl);            hash[temp][1]++;        }        if(maxw!=maxl)        {            printf("No solution.\n");            continue;        }        for(i=1;i<=maxw;i++)        {            if(hash[i][0]||hash[i][1])            {                a_min+=Max(hash[i][0],hash[i][1])*i;            }            temp=0;            if(hash[i][0])            {                for(j=1;j<=maxl;j++)                {                    if(hash[j][1])temp+=Min(i,j)*hash[j][1];                }            }            a_max+=temp*hash[i][0];        }        printf("%I64d %I64d\n",a_min,a_max);    }}
                           ^
0_0_19230786_6878.cpp:11:77: error: a function-definition is not allowed here before '{' token
 #define i64 __int64int Max(int a,int b){return a>b?a:b;}int Min(int a,int b){return a<b?a:b;}int n,m; 
                                                                             ^
0_0_19230786_6878.cpp:14:27: note: in expansion of macro 'i64'
 int i,maxw,maxl,j;        i64 a_min,a_max,temp;        a_min=a_max=0;        maxw=maxl=0;        for(i=0;i<5555;i++)hash[i][0]=hash[i][1]=0;        for(i=0;i<n;i++)        {            scanf("%d",&temp);            maxw=Max(temp,maxw);            hash[temp][0]++;        }        for(i=0;i<m;i++)        {            scanf("%d",&temp);            maxl=Max(temp,maxl);            hash[temp][1]++;        }        if(maxw!=maxl)        {            printf("No solution.\n");            continue;        }        for(i=1;i<=maxw;i++)        {            if(hash[i][0]||hash[i][1])            {                a_min+=Max(hash[i][0],hash[i][1])*i;            }            temp=0;            if(hash[i][0])            {                for(j=1;j<=maxl;j++)                {                    if(hash[j][1])temp+=Min(i,j)*hash[j][1];                }            }            a_max+=temp*hash[i][0];        }        printf("%I64d %I64d\n",a_min,a_max);    }}
                           ^
0_0_19230786_6878.cpp:14:31: error: 'a_min' was not declared in this scope
 int i,maxw,maxl,j;        i64 a_min,a_max,temp;        a_min=a_max=0;        maxw=maxl=0;        for(i=0;i<5555;i++)hash[i][0]=hash[i][1]=0;        for(i=0;i<n;i++)        {            scanf("%d",&temp);            maxw=Max(temp,maxw);            hash[temp][0]++;        }        for(i=0;i<m;i++)        {            scanf("%d",&temp);            maxl=Max(temp,maxl);            hash[temp][1]++;        }        if(maxw!=maxl)        {            printf("No solution.\n");            continue;        }        for(i=1;i<=maxw;i++)        {            if(hash[i][0]||hash[i][1])            {                a_min+=Max(hash[i][0],hash[i][1])*i;            }            temp=0;            if(hash[i][0])            {                for(j=1;j<=maxl;j++)                {                    if(hash[j][1])temp+=Min(i,j)*hash[j][1];                }            }            a_max+=temp*hash[i][0];        }        printf("%I64d %I64d\n",a_min,a_max);    }}
                               ^
0_0_19230786_6878.cpp:14:37: error: 'a_max' was not declared in this scope
 int i,maxw,maxl,j;        i64 a_min,a_max,temp;        a_min=a_max=0;        maxw=maxl=0;        for(i=0;i<5555;i++)hash[i][0]=hash[i][1]=0;        for(i=0;i<n;i++)        {            scanf("%d",&temp);            maxw=Max(temp,maxw);            hash[temp][0]++;        }        for(i=0;i<m;i++)        {            scanf("%d",&temp);            maxl=Max(temp,maxl);            hash[temp][1]++;        }        if(maxw!=maxl)        {            printf("No solution.\n");            continue;        }        for(i=1;i<=maxw;i++)        {            if(hash[i][0]||hash[i][1])            {                a_min+=Max(hash[i][0],hash[i][1])*i;            }            temp=0;            if(hash[i][0])            {                for(j=1;j<=maxl;j++)                {                    if(hash[j][1])temp+=Min(i,j)*hash[j][1];                }            }            a_max+=temp*hash[i][0];        }        printf("%I64d %I64d\n",a_min,a_max);    }}
                                     ^
0_0_19230786_6878.cpp:14:43: error: 'temp' was not declared in this scope
 int i,maxw,maxl,j;        i64 a_min,a_max,temp;        a_min=a_max=0;        maxw=maxl=0;        for(i=0;i<5555;i++)hash[i][0]=hash[i][1]=0;        for(i=0;i<n;i++)        {            scanf("%d",&temp);            maxw=Max(temp,maxw);            hash[temp][0]++;        }        for(i=0;i<m;i++)        {            scanf("%d",&temp);            maxl=Max(temp,maxl);            hash[temp][1]++;        }        if(maxw!=maxl)        {            printf("No solution.\n");            continue;        }        for(i=1;i<=maxw;i++)        {            if(hash[i][0]||hash[i][1])            {                a_min+=Max(hash[i][0],hash[i][1])*i;            }            temp=0;            if(hash[i][0])            {                for(j=1;j<=maxl;j++)                {                    if(hash[j][1])temp+=Min(i,j)*hash[j][1];                }            }            a_max+=temp*hash[i][0];        }        printf("%I64d %I64d\n",a_min,a_max);    }}
                                           ^
0_0_19230786_6878.cpp:14:234: error: 'Max' was not declared in this scope
 int i,maxw,maxl,j;        i64 a_min,a_max,temp;        a_min=a_max=0;        maxw=maxl=0;        for(i=0;i<5555;i++)hash[i][0]=hash[i][1]=0;        for(i=0;i<n;i++)        {            scanf("%d",&temp);            maxw=Max(temp,maxw);            hash[temp][0]++;        }        for(i=0;i<m;i++)        {            scanf("%d",&temp);            maxl=Max(temp,maxl);            hash[temp][1]++;        }        if(maxw!=maxl)        {            printf("No solution.\n");            continue;        }        for(i=1;i<=maxw;i++)        {            if(hash[i][0]||hash[i][1])            {                a_min+=Max(hash[i][0],hash[i][1])*i;            }            temp=0;            if(hash[i][0])            {                for(j=1;j<=maxl;j++)                {                    if(hash[j][1])temp+=Min(i,j)*hash[j][1];                }            }            a_max+=temp*hash[i][0];        }        printf("%I64d %I64d\n",a_min,a_max);    }}
                                                                                                                                                                                                                                          ^
0_0_19230786_6878.cpp:14:366: error: 'Max' was not declared in this scope
 int i,maxw,maxl,j;        i64 a_min,a_max,temp;        a_min=a_max=0;        maxw=maxl=0;        for(i=0;i<5555;i++)hash[i][0]=hash[i][1]=0;        for(i=0;i<n;i++)        {            scanf("%d",&temp);            maxw=Max(temp,maxw);            hash[temp][0]++;        }        for(i=0;i<m;i++)        {            scanf("%d",&temp);            maxl=Max(temp,maxl);            hash[temp][1]++;        }        if(maxw!=maxl)        {            printf("No solution.\n");            continue;        }        for(i=1;i<=maxw;i++)        {            if(hash[i][0]||hash[i][1])            {                a_min+=Max(hash[i][0],hash[i][1])*i;            }            temp=0;            if(hash[i][0])            {                for(j=1;j<=maxl;j++)                {                    if(hash[j][1])temp+=Min(i,j)*hash[j][1];                }            }            a_max+=temp*hash[i][0];        }        printf("%I64d %I64d\n",a_min,a_max);    }}
                                                                                                                                                                                                                                                                                                                                                                              ^
0_0_19230786_6878.cpp:14:639: error: 'Max' was not declared in this scope
 int i,maxw,maxl,j;        i64 a_min,a_max,temp;        a_min=a_max=0;        maxw=maxl=0;        for(i=0;i<5555;i++)hash[i][0]=hash[i][1]=0;        for(i=0;i<n;i++)        {            scanf("%d",&temp);            maxw=Max(temp,maxw);            hash[temp][0]++;        }        for(i=0;i<m;i++)        {            scanf("%d",&temp);            maxl=Max(temp,maxl);            hash[temp][1]++;        }        if(maxw!=maxl)        {            printf("No solution.\n");            continue;        }        for(i=1;i<=maxw;i++)        {            if(hash[i][0]||hash[i][1])            {                a_min+=Max(hash[i][0],hash[i][1])*i;            }            temp=0;            if(hash[i][0])            {                for(j=1;j<=maxl;j++)                {                    if(hash[j][1])temp+=Min(i,j)*hash[j][1];                }            }            a_max+=temp*hash[i][0];        }        printf("%I64d %I64d\n",a_min,a_max);    }}
                                                                                                                                                                                                                                                                    


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-12-02 06:30:13, Gzip enabled