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_20613396_24358.cpp:4:5: error: 'num' does not name a type
     num) ans=num;    if(t==n+1||d==k) return;       __int64 s=num;   s &= sum[t];   if(s>=ans)return;   dfs(t+1,d+1,num&a[t]);   dfs(t+1,d,num);}int main(){    int cas,T=0;    cin>>cas;    while(cas--)    {        scanf("%d %d",&n,&k);        for(int i=1;i<=n;i++)            scanf("%I64d",&a[i]);        sort(a+1,a+n+1);        sum[n]=a[n];        for(int i=n-1;i>=1;i--)            sum[i]=a[i]&sum[i+1];        ans=MAX;        dfs(1,0,MAX);        printf("Case #%d: ",++T);        printf("%I64d\n",ans);    }    return 0;}
     ^
0_0_20613396_24358.cpp:4:22: error: expected unqualified-id before 'if'
     num) ans=num;    if(t==n+1||d==k) return;       __int64 s=num;   s &= sum[t];   if(s>=ans)return;   dfs(t+1,d+1,num&a[t]);   dfs(t+1,d,num);}int main(){    int cas,T=0;    cin>>cas;    while(cas--)    {        scanf("%d %d",&n,&k);        for(int i=1;i<=n;i++)            scanf("%I64d",&a[i]);        sort(a+1,a+n+1);        sum[n]=a[n];        for(int i=n-1;i>=1;i--)            sum[i]=a[i]&sum[i+1];        ans=MAX;        dfs(1,0,MAX);        printf("Case #%d: ",++T);        printf("%I64d\n",ans);    }    return 0;}
                      ^
0_0_20613396_24358.cpp:4:63: error: 'num' was not declared in this scope
     num) ans=num;    if(t==n+1||d==k) return;       __int64 s=num;   s &= sum[t];   if(s>=ans)return;   dfs(t+1,d+1,num&a[t]);   dfs(t+1,d,num);}int main(){    int cas,T=0;    cin>>cas;    while(cas--)    {        scanf("%d %d",&n,&k);        for(int i=1;i<=n;i++)            scanf("%I64d",&a[i]);        sort(a+1,a+n+1);        sum[n]=a[n];        for(int i=n-1;i>=1;i--)            sum[i]=a[i]&sum[i+1];        ans=MAX;        dfs(1,0,MAX);        printf("Case #%d: ",++T);        printf("%I64d\n",ans);    }    return 0;}
                                                               ^
0_0_20613396_24358.cpp:4:70: error: 's' does not name a type
     num) ans=num;    if(t==n+1||d==k) return;       __int64 s=num;   s &= sum[t];   if(s>=ans)return;   dfs(t+1,d+1,num&a[t]);   dfs(t+1,d,num);}int main(){    int cas,T=0;    cin>>cas;    while(cas--)    {        scanf("%d %d",&n,&k);        for(int i=1;i<=n;i++)            scanf("%I64d",&a[i]);        sort(a+1,a+n+1);        sum[n]=a[n];        for(int i=n-1;i>=1;i--)            sum[i]=a[i]&sum[i+1];        ans=MAX;        dfs(1,0,MAX);        printf("Case #%d: ",++T);        printf("%I64d\n",ans);    }    return 0;}
                                                                      ^
0_0_20613396_24358.cpp:4:85: error: expected unqualified-id before 'if'
     num) ans=num;    if(t==n+1||d==k) return;       __int64 s=num;   s &= sum[t];   if(s>=ans)return;   dfs(t+1,d+1,num&a[t]);   dfs(t+1,d,num);}int main(){    int cas,T=0;    cin>>cas;    while(cas--)    {        scanf("%d %d",&n,&k);        for(int i=1;i<=n;i++)            scanf("%I64d",&a[i]);        sort(a+1,a+n+1);        sum[n]=a[n];        for(int i=n-1;i>=1;i--)            sum[i]=a[i]&sum[i+1];        ans=MAX;        dfs(1,0,MAX);        printf("Case #%d: ",++T);        printf("%I64d\n",ans);    }    return 0;}
                                                                                     ^
0_0_20613396_24358.cpp:4:108: error: expected constructor, destructor, or type conversion before '(' token
     num) ans=num;    if(t==n+1||d==k) return;       __int64 s=num;   s &= sum[t];   if(s>=ans)return;   dfs(t+1,d+1,num&a[t]);   dfs(t+1,d,num);}int main(){    int cas,T=0;    cin>>cas;    while(cas--)    {        scanf("%d %d",&n,&k);        for(int i=1;i<=n;i++)            scanf("%I64d",&a[i]);        sort(a+1,a+n+1);        sum[n]=a[n];        for(int i=n-1;i>=1;i--)            sum[i]=a[i]&sum[i+1];        ans=MAX;        dfs(1,0,MAX);        printf("Case #%d: ",++T);        printf("%I64d\n",ans);    }    return 0;}
                                                                                                            ^
0_0_20613396_24358.cpp:4:133: error: expected constructor, destructor, or type conversion before '(' token
     num) ans=num;    if(t==n+1||d==k) return;       __int64 s=num;   s &= sum[t];   if(s>=ans)return;   dfs(t+1,d+1,num&a[t]);   dfs(t+1,d,num);}int main(){    int cas,T=0;    cin>>cas;    while(cas--)    {        scanf("%d %d",&n,&k);        for(int i=1;i<=n;i++)            scanf("%I64d",&a[i]);        sort(a+1,a+n+1);        sum[n]=a[n];        for(int i=n-1;i>=1;i--)            sum[i]=a[i]&sum[i+1];        ans=MAX;        dfs(1,0,MAX);        printf("Case #%d: ",++T);        printf("%I64d\n",ans);    }    return 0;}
                                                                                                                                     ^
0_0_20613396_24358.cpp:4:145: error: expected declaration before '}' token
     num) ans=num;    if(t==n+1||d==k) return;       __int64 s=num;   s &= sum[t];   if(s>=ans)return;   dfs(t+1,d+1,num&a[t]);   dfs(t+1,d,num);}int main(){    int cas,T=0;    cin>>cas;    while(cas--)    {        scanf("%d %d",&n,&k);        for(int i=1;i<=n;i++)            scanf("%I64d",&a[i]);        sort(a+1,a+n+1);        sum[n]=a[n];        for(int i=n-1;i>=1;i--)            sum[i]=a[i]&sum[i+1];        ans=MAX;        dfs(1,0,MAX);        printf("Case #%d: ",++T);        printf("%I64d\n",ans);    }    return 0;}
                                                                                                                                                 ^


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 03:26:33, Gzip enabled