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_20614563_7122.cpp:10:5: error: 'r' does not name a type
     r) continue;        if(sum[r]-sum[i-1]<L || sum[r]-sum[i-1]>=R) continue;        if(sum[l]-sum[i-1]<L || sum[l]-sum[i-1]>=R) continue;        ans+=(long long)(r-l+1)*i+(long long)(l+r)*(r-l+1)/2;     }    return ans;}int main(){    int T;    scanf("%d",&T);    while(T--){        scanf("%d",&n);        sum[0]=0;        for(int i=1;i<=n;i++) {            scanf("%d",&a[i]);            sum[i]=sum[i-1]+a[i];        }        long long ans=0;        for(int k=1;k<=34;k++){            ans+=(long long)k*solve(pow(2,k-1),pow(2,k));        }         ans+=solve(0,1);         printf("%I64d\n",ans);    }    return 0;}
     ^
0_0_20614563_7122.cpp:10:25: error: expected unqualified-id before 'if'
     r) continue;        if(sum[r]-sum[i-1]<L || sum[r]-sum[i-1]>=R) continue;        if(sum[l]-sum[i-1]<L || sum[l]-sum[i-1]>=R) continue;        ans+=(long long)(r-l+1)*i+(long long)(l+r)*(r-l+1)/2;     }    return ans;}int main(){    int T;    scanf("%d",&T);    while(T--){        scanf("%d",&n);        sum[0]=0;        for(int i=1;i<=n;i++) {            scanf("%d",&a[i]);            sum[i]=sum[i-1]+a[i];        }        long long ans=0;        for(int k=1;k<=34;k++){            ans+=(long long)k*solve(pow(2,k-1),pow(2,k));        }         ans+=solve(0,1);         printf("%I64d\n",ans);    }    return 0;}
                         ^
0_0_20614563_7122.cpp:10:86: error: expected unqualified-id before 'if'
     r) continue;        if(sum[r]-sum[i-1]<L || sum[r]-sum[i-1]>=R) continue;        if(sum[l]-sum[i-1]<L || sum[l]-sum[i-1]>=R) continue;        ans+=(long long)(r-l+1)*i+(long long)(l+r)*(r-l+1)/2;     }    return ans;}int main(){    int T;    scanf("%d",&T);    while(T--){        scanf("%d",&n);        sum[0]=0;        for(int i=1;i<=n;i++) {            scanf("%d",&a[i]);            sum[i]=sum[i-1]+a[i];        }        long long ans=0;        for(int k=1;k<=34;k++){            ans+=(long long)k*solve(pow(2,k-1),pow(2,k));        }         ans+=solve(0,1);         printf("%I64d\n",ans);    }    return 0;}
                                                                                      ^
0_0_20614563_7122.cpp:10:147: error: 'ans' does not name a type
     r) continue;        if(sum[r]-sum[i-1]<L || sum[r]-sum[i-1]>=R) continue;        if(sum[l]-sum[i-1]<L || sum[l]-sum[i-1]>=R) continue;        ans+=(long long)(r-l+1)*i+(long long)(l+r)*(r-l+1)/2;     }    return ans;}int main(){    int T;    scanf("%d",&T);    while(T--){        scanf("%d",&n);        sum[0]=0;        for(int i=1;i<=n;i++) {            scanf("%d",&a[i]);            sum[i]=sum[i-1]+a[i];        }        long long ans=0;        for(int k=1;k<=34;k++){            ans+=(long long)k*solve(pow(2,k-1),pow(2,k));        }         ans+=solve(0,1);         printf("%I64d\n",ans);    }    return 0;}
                                                                                                                                                   ^
0_0_20614563_7122.cpp:10:205: error: expected declaration before '}' token
     r) continue;        if(sum[r]-sum[i-1]<L || sum[r]-sum[i-1]>=R) continue;        if(sum[l]-sum[i-1]<L || sum[l]-sum[i-1]>=R) continue;        ans+=(long long)(r-l+1)*i+(long long)(l+r)*(r-l+1)/2;     }    return ans;}int main(){    int T;    scanf("%d",&T);    while(T--){        scanf("%d",&n);        sum[0]=0;        for(int i=1;i<=n;i++) {            scanf("%d",&a[i]);            sum[i]=sum[i-1]+a[i];        }        long long ans=0;        for(int k=1;k<=34;k++){            ans+=(long long)k*solve(pow(2,k-1),pow(2,k));        }         ans+=solve(0,1);         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-11-17 04:31:39, Gzip enabled