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_20613559_29203.cpp:2:5: error: expected unqualified-id before '>' token
     >1;    if(l==r)    {T[k].sum=1;return ;}    build(l,T[k].mid,2*k);    build(T[k].mid+1,r,2*k+1);    T[k].sum=T[2*k].sum+T[2*k+1].sum;}int find(int tot,int k){    int ans;    if(T[k].l==T[k].r)  {T[k].sum=0;return T[k].l;}    if(tot<=T[2*k].sum) ans=find(tot,2*k);    else                ans=find(tot-T[2*k].sum,2*k+1);    T[k].sum=T[2*k].sum+T[2*k+1].sum;    return ans;}int main(){    int T,Case;    int n,m;    int t,temp;    __int64 ans;    scanf("%d",&T);    for(Case=1;Case<=T;Case++)    {        scanf("%d%d",&n,&m);        build(1,n,1);        ans=0;        while(m--)        {            scanf("%d",&t);            ans+=find(t,1);        }        printf("Case %d: %I64d\n",Case,ans);    }    return 0;}
     ^
0_0_20613559_29203.cpp:2:12: error: expected unqualified-id before 'if'
     >1;    if(l==r)    {T[k].sum=1;return ;}    build(l,T[k].mid,2*k);    build(T[k].mid+1,r,2*k+1);    T[k].sum=T[2*k].sum+T[2*k+1].sum;}int find(int tot,int k){    int ans;    if(T[k].l==T[k].r)  {T[k].sum=0;return T[k].l;}    if(tot<=T[2*k].sum) ans=find(tot,2*k);    else                ans=find(tot-T[2*k].sum,2*k+1);    T[k].sum=T[2*k].sum+T[2*k+1].sum;    return ans;}int main(){    int T,Case;    int n,m;    int t,temp;    __int64 ans;    scanf("%d",&T);    for(Case=1;Case<=T;Case++)    {        scanf("%d%d",&n,&m);        build(1,n,1);        ans=0;        while(m--)        {            scanf("%d",&t);            ans+=find(t,1);        }        printf("Case %d: %I64d\n",Case,ans);    }    return 0;}
            ^
0_0_20613559_29203.cpp:2:54: error: expected constructor, destructor, or type conversion before '(' token
     >1;    if(l==r)    {T[k].sum=1;return ;}    build(l,T[k].mid,2*k);    build(T[k].mid+1,r,2*k+1);    T[k].sum=T[2*k].sum+T[2*k+1].sum;}int find(int tot,int k){    int ans;    if(T[k].l==T[k].r)  {T[k].sum=0;return T[k].l;}    if(tot<=T[2*k].sum) ans=find(tot,2*k);    else                ans=find(tot-T[2*k].sum,2*k+1);    T[k].sum=T[2*k].sum+T[2*k+1].sum;    return ans;}int main(){    int T,Case;    int n,m;    int t,temp;    __int64 ans;    scanf("%d",&T);    for(Case=1;Case<=T;Case++)    {        scanf("%d%d",&n,&m);        build(1,n,1);        ans=0;        while(m--)        {            scanf("%d",&t);            ans+=find(t,1);        }        printf("Case %d: %I64d\n",Case,ans);    }    return 0;}
                                                      ^
0_0_20613559_29203.cpp:2:80: error: expected constructor, destructor, or type conversion before '(' token
     >1;    if(l==r)    {T[k].sum=1;return ;}    build(l,T[k].mid,2*k);    build(T[k].mid+1,r,2*k+1);    T[k].sum=T[2*k].sum+T[2*k+1].sum;}int find(int tot,int k){    int ans;    if(T[k].l==T[k].r)  {T[k].sum=0;return T[k].l;}    if(tot<=T[2*k].sum) ans=find(tot,2*k);    else                ans=find(tot-T[2*k].sum,2*k+1);    T[k].sum=T[2*k].sum+T[2*k+1].sum;    return ans;}int main(){    int T,Case;    int n,m;    int t,temp;    __int64 ans;    scanf("%d",&T);    for(Case=1;Case<=T;Case++)    {        scanf("%d%d",&n,&m);        build(1,n,1);        ans=0;        while(m--)        {            scanf("%d",&t);            ans+=find(t,1);        }        printf("Case %d: %I64d\n",Case,ans);    }    return 0;}
                                                                                ^
0_0_20613559_29203.cpp:2:105: error: 'T' does not name a type
     >1;    if(l==r)    {T[k].sum=1;return ;}    build(l,T[k].mid,2*k);    build(T[k].mid+1,r,2*k+1);    T[k].sum=T[2*k].sum+T[2*k+1].sum;}int find(int tot,int k){    int ans;    if(T[k].l==T[k].r)  {T[k].sum=0;return T[k].l;}    if(tot<=T[2*k].sum) ans=find(tot,2*k);    else                ans=find(tot-T[2*k].sum,2*k+1);    T[k].sum=T[2*k].sum+T[2*k+1].sum;    return ans;}int main(){    int T,Case;    int n,m;    int t,temp;    __int64 ans;    scanf("%d",&T);    for(Case=1;Case<=T;Case++)    {        scanf("%d%d",&n,&m);        build(1,n,1);        ans=0;        while(m--)        {            scanf("%d",&t);            ans+=find(t,1);        }        printf("Case %d: %I64d\n",Case,ans);    }    return 0;}
                                                                                                         ^
0_0_20613559_29203.cpp:2:138: error: expected declaration before '}' token
     >1;    if(l==r)    {T[k].sum=1;return ;}    build(l,T[k].mid,2*k);    build(T[k].mid+1,r,2*k+1);    T[k].sum=T[2*k].sum+T[2*k+1].sum;}int find(int tot,int k){    int ans;    if(T[k].l==T[k].r)  {T[k].sum=0;return T[k].l;}    if(tot<=T[2*k].sum) ans=find(tot,2*k);    else                ans=find(tot-T[2*k].sum,2*k+1);    T[k].sum=T[2*k].sum+T[2*k+1].sum;    return ans;}int main(){    int T,Case;    int n,m;    int t,temp;    __int64 ans;    scanf("%d",&T);    for(Case=1;Case<=T;Case++)    {        scanf("%d%d",&n,&m);        build(1,n,1);        ans=0;        while(m--)        {            scanf("%d",&t);            ans+=find(t,1);        }        printf("Case %d: %I64d\n",Case,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 23:34:19, Gzip enabled