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_20612940_2995.cpp:7:25: error: stray '#' in program
     using namespace std;#define lowbit(x) (x&(-x))const int maxn=5e4+10;struct node{    double a,b;    int num;}e[maxn];double l,r;int c[maxn];int cmp1(node x,node y){    if(x.a==y.a)return x.b<y.b;    return x.a<y.a;}int cmp2(node x,node y){    if(x.b==y.b)return x.a>y.a;    return x.b>y.b;}void add(int x,int val){    while(x<maxn)    {        c[x]+=val;        x+=lowbit(x);    }}int sum(int x){    int s=0;    while(x>0)    {        s+=c[x];        x-=lowbit(x);    }    return s;}int main(){    int n;    while(scanf("%d",&n)!=EOF)    {        int t,tt,i,j,ans=0;        double x1,y1,x2,y2,k,b;        t=tt=0;        scanf("%lf%lf",&l,&r);        for(i=0;i<n;i++)        {            scanf("%lf%lf%lf%lf",&x1,&y1,&x2,&y2);            if(x1==x2)            {                if(x1<r&&x1>l)tt++;                continue;            }            k=(y2-y1)/(x2-x1);            b=y1-k*x1;            e[t].a=l*k+b;            e[t++].b=r*k+b;        }        sort(e,e+t,cmp1);        for(i=0;i<t;i++)            e[i].num=i+1;        sort(e,e+t,cmp2);        memset(c,0,sizeof(c));        for(i=0;i<t;i++)        {            add(e[i].num,1);            ans+=sum(e[i].num-1);        }        printf("%d\n",ans+tt*t);    }    return 0;}
                         ^
0_0_20612940_2995.cpp:7:26: error: 'define' does not name a type
     using namespace std;#define lowbit(x) (x&(-x))const int maxn=5e4+10;struct node{    double a,b;    int num;}e[maxn];double l,r;int c[maxn];int cmp1(node x,node y){    if(x.a==y.a)return x.b<y.b;    return x.a<y.a;}int cmp2(node x,node y){    if(x.b==y.b)return x.a>y.a;    return x.b>y.b;}void add(int x,int val){    while(x<maxn)    {        c[x]+=val;        x+=lowbit(x);    }}int sum(int x){    int s=0;    while(x>0)    {        s+=c[x];        x-=lowbit(x);    }    return s;}int main(){    int n;    while(scanf("%d",&n)!=EOF)    {        int t,tt,i,j,ans=0;        double x1,y1,x2,y2,k,b;        t=tt=0;        scanf("%lf%lf",&l,&r);        for(i=0;i<n;i++)        {            scanf("%lf%lf%lf%lf",&x1,&y1,&x2,&y2);            if(x1==x2)            {                if(x1<r&&x1>l)tt++;                continue;            }            k=(y2-y1)/(x2-x1);            b=y1-k*x1;            e[t].a=l*k+b;            e[t++].b=r*k+b;        }        sort(e,e+t,cmp1);        for(i=0;i<t;i++)            e[i].num=i+1;        sort(e,e+t,cmp2);        memset(c,0,sizeof(c));        for(i=0;i<t;i++)        {            add(e[i].num,1);            ans+=sum(e[i].num-1);        }        printf("%d\n",ans+tt*t);    }    return 0;}
                          ^
0_0_20612940_2995.cpp:7:115: error: 'maxn' was not declared in this scope
     using namespace std;#define lowbit(x) (x&(-x))const int maxn=5e4+10;struct node{    double a,b;    int num;}e[maxn];double l,r;int c[maxn];int cmp1(node x,node y){    if(x.a==y.a)return x.b<y.b;    return x.a<y.a;}int cmp2(node x,node y){    if(x.b==y.b)return x.a>y.a;    return x.b>y.b;}void add(int x,int val){    while(x<maxn)    {        c[x]+=val;        x+=lowbit(x);    }}int sum(int x){    int s=0;    while(x>0)    {        s+=c[x];        x-=lowbit(x);    }    return s;}int main(){    int n;    while(scanf("%d",&n)!=EOF)    {        int t,tt,i,j,ans=0;        double x1,y1,x2,y2,k,b;        t=tt=0;        scanf("%lf%lf",&l,&r);        for(i=0;i<n;i++)        {            scanf("%lf%lf%lf%lf",&x1,&y1,&x2,&y2);            if(x1==x2)            {                if(x1<r&&x1>l)tt++;                continue;            }            k=(y2-y1)/(x2-x1);            b=y1-k*x1;            e[t].a=l*k+b;            e[t++].b=r*k+b;        }        sort(e,e+t,cmp1);        for(i=0;i<t;i++)            e[i].num=i+1;        sort(e,e+t,cmp2);        memset(c,0,sizeof(c));        for(i=0;i<t;i++)        {            add(e[i].num,1);            ans+=sum(e[i].num-1);        }        printf("%d\n",ans+tt*t);    }    return 0;}
                                                                                                                   ^
0_0_20612940_2995.cpp:7:138: error: 'maxn' was not declared in this scope
     using namespace std;#define lowbit(x) (x&(-x))const int maxn=5e4+10;struct node{    double a,b;    int num;}e[maxn];double l,r;int c[maxn];int cmp1(node x,node y){    if(x.a==y.a)return x.b<y.b;    return x.a<y.a;}int cmp2(node x,node y){    if(x.b==y.b)return x.a>y.a;    return x.b>y.b;}void add(int x,int val){    while(x<maxn)    {        c[x]+=val;        x+=lowbit(x);    }}int sum(int x){    int s=0;    while(x>0)    {        s+=c[x];        x-=lowbit(x);    }    return s;}int main(){    int n;    while(scanf("%d",&n)!=EOF)    {        int t,tt,i,j,ans=0;        double x1,y1,x2,y2,k,b;        t=tt=0;        scanf("%lf%lf",&l,&r);        for(i=0;i<n;i++)        {            scanf("%lf%lf%lf%lf",&x1,&y1,&x2,&y2);            if(x1==x2)            {                if(x1<r&&x1>l)tt++;                continue;            }            k=(y2-y1)/(x2-x1);            b=y1-k*x1;            e[t].a=l*k+b;            e[t++].b=r*k+b;        }        sort(e,e+t,cmp1);        for(i=0;i<t;i++)            e[i].num=i+1;        sort(e,e+t,cmp2);        memset(c,0,sizeof(c));        for(i=0;i<t;i++)        {            add(e[i].num,1);            ans+=sum(e[i].num-1);        }        printf("%d\n",ans+tt*t);    }    return 0;}
                                                                                                                                          ^
0_0_20612940_2995.cpp: In function 'void add(int, int)':
0_0_20612940_2995.cpp:7:330: error: 'maxn' was not declared in this scope
     using namespace std;#define lowbit(x) (x&(-x))const int maxn=5e4+10;struct node{    double a,b;    int num;}e[maxn];double l,r;int c[maxn];int cmp1(node x,node y){    if(x.a==y.a)return x.b<y.b;    return x.a<y.a;}int cmp2(node x,node y){    if(x.b==y.b)return x.a>y.a;    return x.b>y.b;}void add(int x,int val){    while(x<maxn)    {        c[x]+=val;        x+=lowbit(x);    }}int sum(int x){    int s=0;    while(x>0)    {        s+=c[x];        x-=lowbit(x);    }    return s;}int main(){    int n;    while(scanf("%d",&n)!=EOF)    {        int t,tt,i,j,ans=0;        double x1,y1,x2,y2,k,b;        t=tt=0;        scanf("%lf%lf",&l,&r);        for(i=0;i<n;i++)        {            scanf("%lf%lf%lf%lf",&x1,&y1,&x2,&y2);            if(x1==x2)            {                if(x1<r&&x1>l)tt++;                continue;            }            k=(y2-y1)/(x2-x1);            b=y1-k*x1;            e[t].a=l*k+b;            e[t++].b=r*k+b;        }        sort(e,e+t,cmp1);        for(i=0;i<t;i++)            e[i].num=i+1;        sort(e,e+t,cmp2);        memset(c,0,sizeof(c));        for(i=0;i<t;i++)        {            add(e[i].num,1);            ans+=sum(e[i].num-1);        }        printf("%d\n",ans+tt*t);    }    return 0;}
                                                                                                                                                                                                                                                                                                                                          ^
0_0_20612940_2995.cpp:7:348: error: 'c' was not declared in this scope
     using namespace std;#define lowbit(x) (x&(-x))const int maxn=5e4+10;struct node{    double a,b;    int num;}e[maxn];double l,r;int c[maxn];int cmp1(node x,node y){    if(x.a==y.a)return x.b<y.b;    return x.a<y.a;}int cmp2(node x,node y){    if(x.b==y.b)return x.a>y.a;    return x.b>y.b;}void add(int x,int val){    while(x<maxn)    {        c[x]+=val;        x+=lowbit(x);    }}int sum(int x){    int s=0;    while(x>0)    {        s+=c[x];        x-=lowbit(x);    }    return s;}int main(){    int n;    while(scanf("%d",&n)!=EOF)    {        int t,tt,i,j,ans=0;        double x1,y1,x2,y2,k,b;        t=tt=0;        scanf("%lf%lf",&l,&r);        for(i=0;i<n;i++)        {            scanf("%lf%lf%lf%lf",&x1,&y1,&x2,&y2);            if(x1==x2)            {                if(x1<r&&x1>l)tt++;                continue;            }            k=(y2-y1)/(x2-x1);            b=y1-k*x1;            e[t].a=l*k+b;            e[t++].b=r*k+b;        }        sort(e,e+t,cmp1);        for(i=0;i<t;i++)            e[i].num=i+1;        sort(e,e+t,cmp2);        memset(c,0,sizeof(c));        for(i=0;i<t;i++)        {            add(e[i].num,1);            ans+=sum(e[i].num-1);        }        printf("%d\n",ans+tt*t);    }    return 0;}
                                                                                                                                                                                                                                                                                                                                                            ^
0_0_20612940_2995.cpp:7:377: error: 'lowbit' was not declared in this scope
     using namespace std;#define lowbit(x) (x&(-x))const int maxn=5e4+10;struct node{    double a,b;    int num;}e[maxn];double l,r;int c[maxn];int cmp1(node x,node y){    if(x.a==y.a)return x.b<y.b;    return x.a<y.a;}int cmp2(node x,node y){    if(x.b==y.b)return x.a>y.a;    return x.b>y.b;}void add(int x,int val){    while(x<maxn)    {        c[x]+=val;        x+=lowbit(x);    }}int sum(int x){    int s=0;    while(x>0)    {        s+=c[x];        x-=lowbit(x);    }    return s;}int main(){    int n;    while(scanf("%d",&n)!=EOF)    {        int t,tt,i,j,ans=0;        double x1,y1,x2,y2,k,b;        t=tt=0;        scanf("%lf%lf",&l,&r);        for(i=0;i<n;i++)        {            scanf("%lf%lf%lf%lf",&x1,&y1,&x2,&y2);            if(x1==x2)            {                if(x1<r&&x1>l)tt++;                continue;            }            k=(y2-y1)/(x2-x1);            b=y1-k*x1;            e[t].a=l*k+b;            e[t++].b=r*k+b;        }        sort(e,e+t,cmp1);        for(i=0;i<t;i++)            e[i].num=i+1;        sort(e,e+t,cmp2);        memset(c,0,sizeof(c));        for(i=0;i<t;i++)        {            add(e[i].num,1);            ans+=sum(e[i].num-1);        }        printf("%d\n",ans+tt*


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-06-29 11:08:10, Gzip enabled